Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
Hi Frank and all,
Could some one give me a SORT Code to do following.
My requirement is to delete all the records from an Input file, where number of records has exceeded a limit (limit=5 in below case).
I have a key field in the file, & My O/P file should not have more than 5 records per key. So I want to delete all occurrences of the records for that key after first 5 records.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
The DFSORT job below will do what you asked for. I assumed that the records were already sorted as shown in your example. If not, replace OPTION COPY with a SORT statement for 1,3,CH,A.
You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's RESTART function. Only DFSORT has this function, so if you don't have DFSORT, you won't be able to use it. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see: