Example 4
-
The JOB statement gives EDITMERG as the jobname.
-
The EXEC statement identifies SYNCSORT as the program to be executed.
-
The STEPLIB DD statement instructs the system to look for MFX in the library named SORT.RESI.DENCE. The DISP shows the library may be shared.
-
The SYSOUT DD statement assigns the MFX messages to the output device associated with SYSOUT class A.
-
Three data sets are to be merged: SALES91, SALES92 and SALES93. SALES91 and SALES92 are found on standard labeled tapes with the volume serial numbers 123456 and 654321, respectively. The DD statement for SALES93 specifies a 3390 disk device with the volume serial number DISK11. These three data sets are already in existence, and the disk data set SALES93 may be shared. They are assigned distinct SORTINnn numbers, as required.
-
The SORTOUT DD statement assigns the name SALES.PATTERN to the output data set and specifies a 3390 disk device with the volume serial number DISK08. Five cylinders of primary space have been allocated on this volume. The data set does not yet exist. DCB parameters are provided, preventing them from defaulting to those of the SORTIN08 file.
-
The SYSIN DD statement marks the beginning of the system input stream that includes the sort control statements.
-
The MERGE control statement specifies one control field. It begins on byte 5 (the first data byte of the record since TYPE=V is specified on the RECORD statement) and is 4 bytes long. This field contains zoned decimal data and is to be merged in ascending order.
-
The RECORD statement indicates that variable-length records are being merged and indicates the record length at various processing stages. The maximum input record length is specified as 100 bytes. Since there is no E15, the post-E15 length value is not coded and so defaults to this figure. The INREC statement reduces this maximum record length to just 20 bytes.
-
According to the RECORD control statement, the input record may be 100 bytes long. The INREC statement reduces each record to the 20 bytes crucial to this application: the 4-byte RDW and 4-byte merge control field (i.e., the first 8 bytes of the record), the 6-byte field beginning at byte 29 (the 25th data byte) and the 6-byte field beginning at byte 12 (the 8th data byte). As required, the RDW remains in the first four bytes. The records to be merged are no more than 20 bytes long and contain three fields following the RDW.
-
The delimiter statement marks the end of the SYSIN input stream.
A Copy without Exit Routines
Example 5
-
The JOB statement gives COPYNYC as the jobname.
-
The EXEC statement identifies SYNCSORT as the program to be executed.
-
The STEPLIB DD statement instructs the system to look for MFX in the library named SORT.RESI.DENCE. The DISP shows the library may be shared.
-
The SYSOUT DD statement assigns the MFX messages to the output device associated with SYSOUT class A.
-
The SORTIN DD statement indicates the file to be copied. The data set name is USA.OUTLETS, and it is found on the standard labeled tape with the volume serial number 149200. The data set is already in existence.
-
The SORTOUT DD statement names the copied file NYC.OUTLETS, and specifies a 3390 disk device with the volume serial number of DISK08. Five cylinders of primary space have been allocated on this volume. The data set does not yet exist, but is to be kept whether or not the job terminates normally. The DCB RECFM and LRECL parameters for SORTOUT default to that of the first SORTIN file. The BLKSIZE will be selected by System Determined BLKSIZE (SDB) if active or by MFX if SDB is not active.
-
The SYSIN DD statement marks the beginning of the system input stream that includes the sort control statements.
-
The FIELDS parameter specifies a copy application. This could have been coded as MERGE FIELDS=COPY without affecting program execution.
-
The INCLUDE control statement edits the USA.OUTLETS input file, eliminating all records which do not have the character string NYC in bytes 56-58. Only 'NYC' records will be copied.
-
The delimiter statement marks the end of the SYSIN input stream.