Adding the counts of duplicates while keeping the duplicate.
Posted: Tue May 16, 2017 1:31 pm
Hi,
I'm struggling with a situation where I want to find records in a file that have duplicate values in one part of the record. I can do this, but I also want to retain all records in the output.
Here is the example:
Input:
outfile:
I've used this:
But it's not working as per expectation and am getting this as output:
I actually want to keep the duplicate records, while the above one removes them. How can I do that, please advise me on this.
Thanks
I'm struggling with a situation where I want to find records in a file that have duplicate values in one part of the record. I can do this, but I also want to retain all records in the output.
Here is the example:
Input:
Code: Select all
ABCDEF
ABCDEF
ABCDEF
ABCDEF
FGHIJK
FGHIJK
FGHIJK
FGHIJK
Code: Select all
ABCDEF 4
ABCDEF 4
ABCDEF 4
FGHIJK 4
FGHIJK 4
FGHIJK 4
FGHIJK 4
Code: Select all
INREC FIELDS=(1,6,9:2X,SEQNUM,8,ZD)
SORT FIELDS=(1,6,CH,A)
SUM FIELDS=(11,8,ZD)
Code: Select all
ABCDEF 4
FGHIJK 4
Thanks