Joined: 25 Mar 2007 Posts: 11 Topics: 4 Location: Switzerland
Posted: Tue Feb 03, 2009 12:46 pm Post subject: Add header-records into a data-file
Hi all,
I'm trying to merge 2 files.
The first file is a header-file, the second is a data-file.
In both files are the first four character the group-identification (Id)
I have for each group-identification 0-n headertexts
Not each group-identification must be have a headertext. (we have one headertext-default)
Data-file:
Code:
0001 data
0001 data
0002 data
0002 data
0002 data
0003 data
0003 data
0003 data
0004 data
0004 data
0005 data
0007 data
0007 data
0007 data
0007 data
0008 data
0008 data
0008 data
0009 data
0010 data
0010 data
Not each group-identification must be have datas.
Output should be:
Code:
0001 headertext1
0001 data
0001 data
0002 headertext-default
0002 data
0002 data
0002 data
0003 headertext1
0003 headertext2
0003 headertext3
0003 data
0003 data
0003 data
0004 headertext-default
0004 data
0004 data
0005 headertext1
0005 headertext2
0005 data
0007 headertext1
0007 data
0007 data
0007 data
0007 data
0008 headertext-default
0008 data
0008 data
0008 data
0009 headertext-default
0009 data
0010 headertext-default
0010 data
0010 data
If the data-group (same ID) has no header then i need the default text (but with the same ID as the data-text).
Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
Posted: Tue Feb 03, 2009 4:17 pm Post subject:
hungerbuehler,
The following DFSORT JCL will give you the desired results. I assumed that the header records can be identified with word 'head' in pos 6 in the header record file. I used the WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) in step0200. If you don't have the July, 2008 PTF installed, ask your System Programmer to install it (it's free).
For complete details on the new WHEN=GROUP and the other new functions available with PTF UK90013, see:
Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
Posted: Tue Feb 03, 2009 5:00 pm Post subject:
The following DFSORT JCL will give you the desired results. This job does not require any identification of header. I used the WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) in step0200. If you don't have the July, 2008 PTF installed, ask your System Programmer to install it (it's free).
For complete details on the new WHEN=GROUP and the other new functions available with PTF UK90013, see:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum