Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Example 3 z/OS DFSORT Application Programming Guide SC23-6878-00 |
|
This example illustrates how you can keep the last 5 sorted records. The CTL1CNTL data set contains:
The input records look like this:
We want to sort the records by the CH field in positions 1-15 and
keep the last 5 sorted records. We use KEEP, OUTPUT and LAST(5) to
keep the last 5 output records. We use the SORT statement to sort
the records before they are output. After the SORT statement is executed,
the intermediate records look like this:
After the SUBSET operator is executed, the final output records
look like this:
Note that we could use TRAILER(5) instead of LAST(5). |
Copyright IBM Corporation 1990, 2014
|