Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Sorting records between headers and trailers z/OS DFSORT: Getting Started SC23-6880-00 |
|
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. Suppose you have input records that look like this:
The first record is a header record containing a date, the last
two records are trailer records containing a count and an end indicator,
respectively, and the records between the header and trailer records
are data records containing Subject names. You want to create an
output data set with the Subject names sorted but the header and trailer
records in their original places. Write the following ICETOOL statement:
Include the following DFSORT SORT statement in CTL1CNTL:
The output records would look like this:
For complete details of DATASORT, as well as more examples, see z/OS DFSORT Application Programming Guide. |
Copyright IBM Corporation 1990, 2014
|