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


Example 7. Sort with COBOL E15, EXEC PARM and MSGDDN

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

INPUT
Fixed-length records on disk
OUTPUT
Fixed-length records on SYSDA
WORK DATA SETS
None
USER EXITS
COBOL E15
FUNCTIONS/OPTIONS
MSGDDN
//EXAMP    JOB A400,PROGRAMMER                                  01
//STEP1    EXEC PGM=SORT,PARM='MSGDDN=DFSOUT'                   02
//STEPLIB  DD DSN=SYS1.SCEERUN,DISP=SHR                         03
//SYSOUT   DD SYSOUT=A                                          04
//DFSOUT   DD SYSOUT=A                                          05
//EXITC    DD DSN=COBEXITS.LOADLIB,DISP=SHR                     06
//SORTIN   DD DSN=SORT1.IN,DISP=SHR                             07
//SORTOUT  DD DSN=&&OUT,DISP=(,PASS),SPACE=(CYL,(5,5)),         08
//  UNIT=SYSDA,DCB=(LRECL=120)                                  09
//SYSIN    DD *                                                 10
  SORT FIELDS=(5,4,A,22,2,A),FORMAT=BI                          11
  MODS E15=(COBOLE15,37000,EXITC,C)                             12
  RECORD LENGTH=(,120)                                          13
Line
Explanation
01
JOB statement. Introduces this job to the operating system.
02
EXEC statement. Calls DFSORT directly by its alias name SORT. MSGDDN=DFSOUT specifies an alternate message data set for DFSORT messages and control statements to prevent the COBOL messages in SYSOUT from being interleaved with the DFSORT messages and control statements.
03
STEPLIB statement. Specifies the Language Environment library.
04
SYSOUT statement. Directs COBOL messages to system output class A.
05
DFSOUT statement. Directs DFSORT messages and control statements to system output class A (this is the alternate message data set specified by MSGDDN in the PARM field of the EXEC statement).
06
EXITC statement. Specifies the load library that contains the exit routine.
07
SORTIN DD statement. The input data set is named SORT1.IN and is cataloged. DFSORT determines from the data set label that the RECFM is F, the LRECL is 100 and the BLKSIZE is 100.
08-09
SORTOUT DD statement. The output data set is temporary and is to be allocated on SYSDA. Because the E15 exit changes the length of the records from 100 bytes to 120 bytes, LRECL=120 must be specified. DFSORT sets the RECFM from SORTIN and sets the BLKSIZE to the LRECL (unblocked records).
10
SYSIN DD statement. DFSORT control statements follow.
11
SORT statement. FIELDS specifies an ascending 4-byte control field starting at position 5 and an ascending 2-byte control field starting at position 22. FORMAT specifies that the control fields are binary.
12
MODS statement. E15 specifies a user exit routine named COBOLE15 written in COBOL. Approximately 37000 bytes are required for the exit, the system services (for example, GETMAIN and OPEN) it performs, and the COBOL library subroutines. COBOLE15 resides in the library defined by the EXITC DD statement.
13
RECORD statement. LENGTH specifies that the COBOL E15 routine changes the length of the records to 120 bytes.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014