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


Example 1. Sort with ALTSEQ

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

INPUT
Blocked variable-length records on disk
OUTPUT
Blocked variable-length records on 3490
WORK DATA SETS
Two 3390 data sets
USER EXITS
None
FUNCTIONS/OPTIONS
ALTSEQ
//EXAMP    JOB A400,PROGRAMMER                                  01
//S1       EXEC PGM=SORT                                        02
//SYSOUT   DD SYSOUT=A                                          03
//SORTIN   DD DSN=A123456.IN5,DISP=SHR                          04
//SORTOUT  DD DSN=OUT1,UNIT=3490,DISP=(,KEEP),VOL=SER=VOL001    05
//SORTWK01 DD UNIT=3390,SPACE=(CYL,(10,10))                     06
//SORTWK02 DD UNIT=3390,SPACE=(CYL,(10,10))                     07
//SYSIN    DD *                                                 08
* COLLATE $, # and @ AFTER Z                                    09
  SORT FIELDS=(7,5,AQ,A)                                        10
  ALTSEQ CODE=(5BEA,7BEB,7CEC)                                  11
Line
Explanation
01
JOB statement. Introduces this job to the operating system.
02
EXEC statement. Calls DFSORT directly by its alias SORT.
03
SYSOUT DD statement. Directs DFSORT messages and control statements to system output class A.
04
SORTIN DD statement. The input data set is named A123456.IN5 and is cataloged. DFSORT determines from the data set label that the RECFM is VB, the maximum LRECL is 120, and the BLKSIZE is 2200.
05
SORTOUT DD statement. The output data set is named OUT1 and is to be allocated on 3490 volume VOL001 and kept. DFSORT sets the RECFM and LRECL from SORTIN and selects an appropriate BLKSIZE for this standard labeled tape.
06
SORTWK01 DD statement. The first work data set is allocated on 3390.
07
SORTWK02 DD statement. The second work data set is allocated on 3390.
08
SYSIN DD statement. DFSORT control statements follow.
09
Comment statement. Printed but otherwise ignored.
10
SORT statement. FIELDS specifies an ascending 5-byte character control field starting at position 7 (the third data byte, because the RDW occupies the first 4 bytes). The control field is to be collated according to the modified sequence described in the ALTSEQ statement.
11
ALTSEQ statement. CODE specifies that the three characters $, # and @ are to collate in that order after Z.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014