I have a flat file which can have 2 records with same key. My requirement is to fetch first occurrence among the duplicates from the flat file using DFSORT. Can you guys help me.
I just want to expand the situation. The flat file created contains the records from two input flat files. I have merged these two input files by using DFSORT - MERGE=COPY command.
Now the requirement is changed. I want the records from these two input flat files to be sort/merged and loaded into one VSAM file having key from 1-43 location. In case the two flat files have record with same key, the record from first file has to be loaded into VSAM file directly. We dont want any intermediate workfile.
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
Quote:
In case the two flat files have record with same key, the record from first file has to be loaded into VSAM file directly.
If both the files have the same LRECL and DSORG then make a concatenated DD statement in SORTIN and use the technique on ibmmainframes.com/post-98317.html
If this is not the solution you are looking for, then it would be better if you give us more information, like show the input/output records. LRECL,DSORG of the i/p files.
I have tried using JOINKEYS but i do not know how can we use both F1 and F2 Full LRECL Length in REFORMAT. Because
1) I need complete record from F1 if there any key present in both F1 and F2
2) I need complete record F1 if its un-paired record ( i.e. Its available only in F1)
3) I need complete record F2 if its un-paired record ( i.e. Its available only in F2)
We have done using ICETOOL but people wants either DFSORT - SORT Utility( Not with ICETOOL) / Join Keys.
It takes the record from second file and writes into output file If the key present in both the file. But I need to write from 1st file if key is available in both the files. Can you please help me.