Posted: Fri Dec 20, 2024 12:12 pm Post subject: Mixed dups.
Good day everyone and Happy Holiday Season!
Could someone, please, let me know how to accomplish the following with DFSORT step (SORT or ICETOOL).
I have a dataset, FB LRECL=80, where there could be duplicate Account-No records accompanied by Account-Class values.
There could be three types of duplicates:
- duplicate Account-No recs within Account-Class '9'
- duplicate Account-No recs between Account-Class '9' and Account-Class '5'
- duplicate Account-No recs within Account-Class '9' AND a record from Account-Class '5'
- there could never be duplicate Account-No recs within Account-Class '5'.
All duplicates within Account-Class '9' should go to an Output. Also recs of Account-Class '9' take precedence over Class '5', so if there are duplicate Accounts from both Classes, only Account-Class '9' should make it to the Output.
And non-dups from Account-Class '5' should also be in the Output.
Input records could be sorted in any order, as needed.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Fri Dec 20, 2024 5:29 pm Post subject:
ramy2016,
You need to use the trick of joinkeys matching the file to it self. The second file will count the number of duplicates and upon matching every record has the counter. Now we can just eliminate the records with dup count > 1 and class of '5' on OUTFIL
Here is an untested DFSORT JCL which will give you the desired results
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