Example 1
-
The JOB statement gives SORTOMIT as the jobname.
-
The EXEC statement identifies SYNCSORT as the program to be executed. The STOPAFT PARM instructs MFX to terminate after sorting 1,000 records.
-
The STEPLIB DD statement instructs the system to look for MFX in the library named SORT.RESI.DENCE. The DISP indicates that this 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 gives INPUT as the input data set name, specifies a 3490 tape unit with the volume serial number 012345. The data set is already in existence.
The DCB parameter shows an LRECL of 100 bytes, a fixed blocked RECFM, and a 32700-byte BLKSIZE. The LABEL parameter shows that INPUT is the first data set on the tape, and that it has a standard label.
-
The SORTOUT DD statement gives OUTPUT as the output data set name, and specifies a 3490 tape unit with the volume serial number 543210. The data set is not in existence yet.
The DCB parameter for SORTOUT specifies the same LRECL and RECFM as SORTIN. The BLKSIZE will be selected by System Determined BLKSIZE (SDB) if active or by MFX if SDB is not active.
-
The five SORTWKxx DD statements reserve space on direct access devices for intermediate storage. Twenty cylinders are allocated for each of the five SORTWKxx data sets.
-
The SYSIN DD * statement marks the beginning of the system input stream that includes the sort control statements.
-
The SORT control statement specifies that one control field will be sorted on. It begins on byte 1 of the record, is 8 bytes long, contains character data, and is to be sorted in ascending order.
-
The OMIT control statement eliminates any record with JOHN DOE in its first eight bytes (i.e., in the sort control key). JOHN DOE records are not sorted and are not included in the STOPAFT figure. The EXEC statement’s STOPAFT PARM terminates the sort after 1,000 (non-JOHN DOE) records have been put into the proper sequence.
-
The END control statement marks the end of the control statements.
-
The delimiter statement marks the end of the SYSIN input stream.
Example 2
-
The JOB statement gives SUMSORT as the jobname.
-
The EXEC statement identifies SYNCSORT as the program to be executed. The EQUALS PARM interacts with the SUM control statement to preserve the first of a series of equal-keyed records.
-
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 class A.
-
The SORTIN DD statements define the input to be copied: two concatenated data sets — FEB92.EMPLOYEE.MASTER and FEB92.EMPLOYEE.UPDATE. They are found on standard labeled 3490 tape units (volume serial numbers 135790 and 999999, respectively). These data sets are already in existence.
-
The SORTOUT DD statement gives MAR92.EMPLOYEE.MASTER as the output data set name and specifies a 3490 tape unit with the volume serial number 246809. The data set is not in existence yet.
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 SORTWK01 DD statement reserves space on a direct access device for intermediate storage. Twenty cylinders are allocated. Intermediate storage must be provided whenever the SUM control statement is used with a sort.
-
The SYSIN DD statement marks the beginning of the system input stream that includes the sort control statements.
-
The SORT control statement specifies that two control fields will be sorted on. The major control field begins on byte 1 of the record, is 9 bytes long, contains zoned decimal data, and is to be sorted in ascending numerical order. The second, less significant, control field is found in the next two bytes of the record (bytes 10 and 11), is in (unsigned) binary format, and is to be sorted in ascending order.
-
Whenever two records have equal control fields, the sort will attempt to sum them. If the result of summing the packed decimal data found in the 4-byte field beginning at byte 12 can be contained in four bytes, one of the two records will be retained, the sum stored in bytes 12-15, and the other record will be deleted. The EQUALS PARM guarantees that the first of the two records will be preserved; thus, if a record from the FEB92.EMPLOYEE.MASTER file has the same key as one from the FEB92.EMPLOYEE.UPDATE file, it is the master record which is retained in the output file, containing their sum.
-
The delimiter statement marks the end of the SYSIN input stream.
Example 3
-
The JOB statement gives SORTSKIP as the jobname.
-
The EXEC statement identifies SYNCSORT as the program to be executed.
-
The $ORTPARM DD statement is used here to initiate a test run of the SORTSKIP job by supplying the STOPAFT PARM to MFX. It instructs MFX to terminate after sorting the first 100 of the records INCLUDE selects from the SKIPREC-edited input file.
-
The STEPLIB DD statement instructs the system to look for MFX in the library named SORT.RESI.DENCE. The DISP indicates that this 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 gives EXPORT.SHIPPING.VOL6 as the input data set name. It is found on a standard labeled tape having the volume serial number 112233. This data set is already in existence.
-
The SORTOUT DD statement assigns the RECENT.MAJOR.EXPORTS data set name to the output file, and specifies a tape unit with the volume serial number 332211. This data set is not yet in existence. The DCB RECFM and LRECL parameters for SORTOUT default to those 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 three SORTWKxx DD statements reserve space on direct access devices for intermediate storage. Twenty cylinders are allocated for each SORTWK data set.
-
The SYSIN DD statement marks the beginning of the system input stream that includes the sort control statements.
-
The SORT control statement specifies that one control field will be sorted on. It begins on byte 19 of the record, is 5 bytes long, contains character data, and is to be sorted according to ascending order. The EQUALS parameter preserves the SORTIN order of records with identical data in these five bytes. The SKIPREC parameter eliminates the first 1,000 records of the SORTIN file from consideration; these records are eliminated before the INCLUDE statement takes effect.
-
The INCLUDE statement compares the 4 bytes beginning with byte 37 of the record to the hexadecimal literal, which will be padded on the right with binary zeros to the indicated (4 byte) length. The record is eliminated from the sort unless the binary data in that field is at least as great as the padded constant. The INCLUDE/OMIT statement takes effect after SKIPREC but before STOPAFT.
-
The delimiter statement marks the end of the SYSIN input stream.