Posted: Wed Nov 17, 2021 11:01 am Post subject: Matching Files using DFSORT
Hi Team,
We have the below requirement. There are two input files. Please let me know if this can be achieved using DFSORT/ICETOOL.
- Input File1 has unique records in sorted order. First 20 bytes is the key. Next 5 bytes is the modified value i would like to overlay while writing into output file. Additionally, Records tagged as 'S' need to be skipped while writing into the output file.
- Input File2 can have multiple records per 1 key in Input File 1. These records are also in sorted order on First 20 bytes.
- Output File will have the records from Input file2. Based on the flag 'S' in Input File1, the corresponding records in Input File2 will be skipped. Input File2 has 9 records, where as Output File has only 8 records. For all the selected records, position 21-25 from Input File 1 need to be overlayed in Output file instead of the original values from Input File 2(Position 16-20).
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Wed Nov 17, 2021 8:25 pm Post subject: Re: Matching Files using DFSORT
erasani wrote:
For all the selected records, position 21-25 from Input File 1 need to be overlayed in Output file instead of the original values from Input File 2(Position 16-20).
erasani,
Your output does not match the above requirement, you simply skipped 1 record.
You need to be clear as to what you want.
what is the LRECL and RECFM of the files involved?
Did you check the following smart DFSORT tricks?
Join fields from two files on a key
Join fields from two files record-by-record
Cartesian join
Create files with matching and non-matching records
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Thu Nov 18, 2021 8:26 pm Post subject:
erasani,
By default JOINKEYS gives you only matched records. So you don't need to check the match indicator and rebuild the record once again as you can build the desired record using REFORMAT itself.
Btw the control cards you show are drastically different from the original requirement. _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
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