DFSORT Sorting Without Sorting Header / Trailer Lines
MartinPacker 11000094DH Comments (3) Visits (15731)
For whoever got to my blog with this Google search here's how you sort data without a header:
First you need to be using z/OS DFSORT Release 10 or to have applied the PTFs for UK90013 (July 2008).
Second, the vehicle for doing this is ICETOOL rather than DFSORT itself.
Use the new DATASORT operator. Here's an example:
If you code
DATASORT FROM(DD1) TO(DD) FIRST(3) USING(CTL1)
and code a CTL1CNTL like
//CTL1CNTL DD * SORT FIEL
ICETOOL will sort everything after the first 3 records, leaving the first 3 records unchanged. (In this case the sorted lines are, obviously, collated on two distinct fields.)
In the CTL1CNTL set of control statements you can code an OUTFIL statement (or several) if you want to. There are some restrictions on what statements you can code in the CTL1CNTL data set (and these are documented here.)
As well as being able to avoid sorting header records (FIR