FILEA has 500k records and FILEB has 100 records . For each record in FILEB there can a matching record in FILEA .FILEA is sorted as per FILEB records. I want to match FILEA and FILEB and want to extract only the first 50 of each matching into one FILEC from FILEA and all the other records into FILED from FILEA(FILEA – FILEC).
FILEA has 500k records and FILEB has 100 records . For each record in FILEB there can a matching record in FILEA .FILEA is sorted as per FILEB records. I want to match FILEA and FILEB and want to extract only the first 50 of each matching into one FILEC from FILEA and all the other records into FILED from FILEA(FILEA – FILEC).
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
MSTP,
I have assumed FB files of LRECL=80 and key fields of both the files starting at pos 1-3 and for extracting 2 matching records from file1 instead of 50. You can modify it as per your file attributes.
I tried with the above SORT parameters. It works to some extent but I am losing records from fileA like rcds ABC 111 which don't have a match to fileB records. Please let me know what modification is needed.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Hello ,
Quote:
It works to some extent but I am losing records from fileA like rcds ABC 111 which don't have a match to fileB records.
From the above post, I assume the jcl ran successfully, but dint produce the results as you expected. Can you post the actual file attributes and the key positions on both the files and also some sample input/output records.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
JOINKEYS implies the OP is using Syncsort, but he told another Moderator in an offline note that he's not using Syncsort. So we need to clear up which product he's using before we go any further with this.