Example 18

 SORT FIELDS=(22,8,CH,A)
 OUTFIL FNAMES=SAMP1,REMOVECC,HEADER1=('Sample 1',2/),
   STARTREC=120,SAMPLE=(20,4),
   OUTREC=(1,8,9,5,PD,ZD,C'***',14,50)
 OUTFIL FNAMES=SAMP2,REMOVECC,HEADER1=('Sample 2',2/),
   SAMPLE=1000,ENDREC=5001

This example illustrates how to take different "samples" of sorted output records. Sorted records 120, 121, 122, 123, 140, 141, 142, 143, and so on will be reformatted as indicated by the OUTREC parameter and written to the output data set associated with SAMP1. The heading 'Sample 1' will appear before the sample output records.

Sorted records 1, 1001, 2001, 3001, 4001 and 5001 will be written to the output data set associated with SAMP2. The heading 'Sample 2' will appear before the sample output records.