z/OS DFSORT Application Programming Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example 2

z/OS DFSORT Application Programming Guide
SC23-6878-00

SUBSET FROM(IN2) TO(OUT2) DISCARD(OUT3) -
  KEEP INPUT RRN(3,4) LAST(3)

This example shows how you can create one output file with relative records and the last n records, and another output file with the remaining records.

The input records look like this:
Algebra
Astronomy
Biology
Calculus
French
Geography
Geometry
Greek
History
Latin
Psychology
Russian

In the first output file (OUT2), we want the third and fourth input records and the last three input records. In the second output file (OUT3), we want the records that are not in the first output file. We use TO(OUT2) and DISCARD(OUT3) for the two output files. We use KEEP, INPUT, RRN(3,4) and LAST(3) to indicate we want to keep relative input records 3 and 4 and the last 3 input records.

The OUT2 records would look like this:
Biology
Calculus
Latin
Psychology
Russian
The OUT3 records would look like this:
Algebra
Astronomy
French
Geography
Geometry
Greek
History

Note that we could use TRAILER(3) instead of LAST(3).

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014