You can use ICETOOL's DATASORT operator to sort the data records in a data set without sorting the header or trailer records. You use the following operands to tell DATASORT the number of header records, trailer records, or header and trailer records in your data set:
DATASORT does not require an "identifier" in the header or trailer records; it can treat the first x records as header records and the last y records as trailer records.
You must specify a USING data set to specify a DFSORT SORT statement that tells DATASORT the fields you want to use to sort your data records. You can use various other DFSORT statements as well; see z/OS DFSORT Application Programming Guide for details.
DATASORT sorts the data records between your header records (first x records of the data set) and trailer records (last y records of the data set) while keeping the header and trailer records in place.
2008/04/23
Geometry
Algebra
Trigonometry
Calculus
0004
End of data set
DATASORT FROM(IN) TO(OUT) HEADER TRAILER(2) USING(CTL1)
SORT FIELDS=(1,16,CH,A)
2008/04/23
Algebra
Calculus
Geometry
Trigonometry
0004
End of data set
For complete details of DATASORT, as well as more examples, see z/OS DFSORT Application Programming Guide.