Append "00000001" to all the records of the file in pos 71 using OUTREC FIELDS=(1,70,C'00000001').
Step2:
Do a SORT with the key field summarizing the last column (Using SORT FIELDS=(1,3,A,10,4,A) AND SUM FIELDS=(71,8,C'00000001')).
Now you'll have only one record for each key with the number of duplicates for that key as the last column (as u requested).
Hope this helps... I don't have the SORT jcl for this right now.. let me know if you need one.
But here should be 3 groups. Maybe it makes sense to copy the key as one string by INREC somewhere to the right of 80th pos to check it then by RESTART. This approach could help as well to separate the groups by blank line as requested by the customer (by SECTION). I'll try to realize it, but any help would be greatly appreciated.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Quote:
But here should be 3 groups. Maybe it makes sense to copy the key as one string by INREC somewhere to the right of 80th pos to check it then by RESTART. This approach could help as well to separate the groups by blank line as requested by the customer (by SECTION). I'll try to realize it, but any help would be greatly appreciated.
Andrew Shinkarev,
You got only 2 groups because I just considered only the first 3 bytes as a group. I guess you need to even consider the 10, 4 bytes also as part of the group. Change your CTL2 control cards to the following and you will get the desired results