Posted: Fri May 28, 2010 5:04 am Post subject: counting duplicates in sort
Hi,
I've a file whose LRECL=153. key is at position 63 to 72. I've 1 in positon 152-153 (s9(4) comp) for all the records in the file. I've duplicates in the key(position 63-72). Now, I would like to sort the file on key(63-72) and have the duplicate record count in position 152-153.
for eg
input file:(assume 1111,2222 is the key)
ab 1111 1
cd 2222 1
ef 1111 1
gh 2222 1
ij 1111 1
output file shoule look like(if key matches, add the last byte values)
ab 1111 3
ef 1111 3
ij 1111 3
cd 2222 2
gh 2222 2
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Fri May 28, 2010 11:11 am Post subject:
koolspark,
With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), DFSORT now supports the JOINKEYS function which can do this kind of thing much more easily. use the same file for both SORTJNF1 and SORTJNF2. The JNF2 file will be summed to get the total no: of duplicates and joined on to the JNF1
Thank you very much Kolusu. It really worked.. . I tried almost all the options which i know of(sum fields,add,count,splice, outfil, sections with Trailer3). All these options were giving me the count, but eliminating the duplicates.
once again thank you very much & Appreciate your help.
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