Author: Bill Woodger
Subject: Reply to: Limit duplicate records in the SORT
Posted: Mon Nov 21, 2016 2:22 pm (GMT 5.5)
Assuming your data is in key order, extend record temporarily with a sequence number, with RESTART= for the key, and out OUTFIL with INCLLUDE=/OMIT= to do the limiting, with BUILD to drop off the extension.
The same could be achieved with WHEN=GROUP, but if the key is on each record, in the same position, then it is better to use the plain sequence number.
Subject: Reply to: Limit duplicate records in the SORT
Posted: Mon Nov 21, 2016 2:22 pm (GMT 5.5)
Assuming your data is in key order, extend record temporarily with a sequence number, with RESTART= for the key, and out OUTFIL with INCLLUDE=/OMIT= to do the limiting, with BUILD to drop off the extension.
The same could be achieved with WHEN=GROUP, but if the key is on each record, in the same position, then it is better to use the plain sequence number.