Savitha Muthukrishnan
New User
Joined: 31 Dec 2006 Posts: 8 Location: Chennai
|
|
|
|
Hi
My requirement is :
I have two files of different record lengths. I need to combine all the columns of the two files in to a single file , with the common columns(headings) occurring only once in the output file.
Example :
File A:
columns : id, no, date, month
File B:
columns : week, id, no,
I need to create an output file with the columns :
id,no,date,month,week (the common columns id and no should occur only once). When i try to match the records in the files using the id and no fields as the key, if i find a match , the corresponding fields should be populated in the output file.
If a id , no record combination occurs only in file, then it should be written in to the output file with the columns corresponding to the second file being populated with spaces
Can this be done using a jcl, or do i have to do it through a program to compare the files based on id and no and write the output file |
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
Can this be done using a jcl, or do i have to do it through a program to compare the files based on id and no and write the output file |
Yes, it can be done using JCL SORT... check if below stuff work for you, else writing program can also be accomplished for the same... not a big deal...
Here is a solution by DFSORT of what you are asking for... You would need to change the SORT Code adjusting length & position of the common key fields for two files... alongwith total length of the files...
Look for the topic described for:- Join fields from two files on a key |
|