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


Example 3. Sort with ASCII tapes

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

INPUT
Variable-length ASCII records on 3590
OUTPUT
Variable-length ASCII records on 3590
WORK DATA SETS
One SYSDA data set
USER EXITS
None
FUNCTIONS/OPTIONS
None
//EXAMP    JOB A400,PROGRAMMER                                  01
//RUNIT    EXEC SORTD                                           02
//SORTIN   DD DSN=SRTFIL,DISP=(OLD,DELETE),UNIT=3590,           03
//  DCB=(RECFM=D,LRECL=400,BLKSIZE=404,OPTCD=Q,BUFOFF=L),       04
//  VOL=SER=311500,LABEL=(1,AL)                                 05
//SORTOUT  DD DSN=OUTFIL,UNIT=3590,LABEL=(,AL),DISP=(,KEEP),    06
//  DCB=(BLKSIZE=404,OPTCD=Q,BUFOFF=L),VOL=SER=311501           07
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(4))                        08
//SYSIN    DD *                                                 09
  SORT FIELDS=(10,8,AC,D)                                       10
  RECORD TYPE=D,LENGTH=(,,,20,80)                               11
Line
Explanation
01
JOB statement. Introduces this job to the operating system.
02
EXEC statement. Uses the SORTD cataloged procedure to call DFSORT directly.
03-05
SORTIN DD statement. The input data set is named SRTFIL and resides on 3590 volume 311500. It is to be deleted after this job step. It has a RECFM of D (variable-length ASCII records), a maximum LRECL of 400, a BLKSIZE of 404 and an ASCII label. For this job, the buffer offset is the block length indicator. The records are to be translated from ASCII to EBCDIC.
06-07
SORTOUT DD statement. The output data set is named OUTFIL and is to be allocated on 3590 volume 311501 and kept. It is to be written with an ASCII label. DFSORT sets the RECFM and LRECL from SORTIN and sets the BLKSIZE to 404 as indicated in the DD statement. For this job, the buffer offset is the block length indicator. The records are to be translated from EBCDIC to ASCII.
08
SORTWK01 DD statement. The work data set is allocated on SYSDA.
09
SYSIN DD statement. DFSORT control statements follow.
10
SORT statement. FIELDS specifies a descending 8-byte ASCII control field starting at position 10.
11
RECORD statement. TYPE specifies ASCII variable-length records. LENGTH specifies that the minimum record length is 20 and the average record length is 80.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014