An installation is running a 100 gigabyte sort and has a restricted amount of disk space available for SORTWK across ten volumes (WORK1, WORK2, ...WORK10). The JCL for this job follows.
-
This job step is run in order to allocate the disk space for the breakpoint data set via IBM utility program IEFBR14.
-
This statement allocates the space for the breakpoint data set. Specify (NEW,CATLG) because this data set must be saved.
-
The EXEC statement initiates the regular MFX program, and the MAXSORT PARM is specified, as required. This job requests a minimum of 6000 cylinders of disk space for SORTWKnn data sets. If that much space cannot be obtained during the job, the program will terminate.
-
The SORTBKPT DD statement is required for all MAXSORTs. It identifies the breakpoint data set which was allocated in the first job step. DISP=(OLD,KEEP) is specified so that this statement can be reused if MAXSORT is restarted.
-
These DD statements are coded just as they would be for an ordinary sort.
-
The SORTWKnn DD statements must be allocated to disk or MAXSORT will terminate. In this case, 3000 cylinders of primary space have been allocated. Secondary allocation could provide up to 2625 cylinders on each volume if that amount of free space exists. Since the MINWKSP PARM specifies at least 6000 cylinders, this program will terminate unless 3000 cylinders of secondary space can be obtained.
-
The SORTOU00 DD statement is required for this job because the intermediate sort output will be stored on tape. DISP=(NEW,KEEP), a permanent DSN and VOL=PRIVATE are specified to ensure that the system unloads each output tape. The DEFER option in the UNIT parameter is specified so that mount messages to the operator that do not pertain to MAXSORT are suppressed.
-
The SORTOU01, SORTOU02 and SORTOU03 DD statements allocate the tape units used as input to the merge phase. Permanent DSNAMEs, DISP=(NEW,KEEP), VOL=PRIVATE and the DEFER option in the UNIT parameter are all specified just as they were for the SORTOU00 DD statement.
-
The sort control statements are included here.
Example 2: Restarting the MAXSORT in Example 1 from a Breakpoint
Example 1 can be restarted from a breakpoint simply by submitting the original job control stream without the job step which allocated space for the breakpoint data set. The job will be restarted from the last breakpoint because RESTART=LAST is the default; it is not necessary to specify RESTART=LAST on the EXEC statement.
The JCL is identical to the JCL in Example 1 except that the step which allocated the disk space for the breakpoint data set is not resubmitted.
Example 3: A 100 Gigabyte MAXSORT with Dynamic Tape Allocation
This example is identical to Example 1 with one difference: the DYNATAPE PARM requests dynamic tape allocation.
The DYNATAPE PARM requests that tape units be obtained dynamically. Because DYNATAPE has been specified, the SORTOU01, SORTOU02, and SORTOU03 DD statements specified in Example 1 do not have to be supplied. They will be created and dynamically allocated when needed. If enough tape units are available at the time the job is run, the sort will be successfully completed in one step.
However, there may not be enough tape devices available under dynamic allocation at execution time. In that case, the job will terminate and can be restarted at a later time when more tape units are available.
For best results, code two SORTOUnn DD statements in addition to specifying the DYNATAPE PARM as the above example illustrates. This approach ensures that MAXSORT will have the minimum two tape units needed for the merge phase and also allows MAXSORT to take advantage of the additional tapes available under dynamic allocation.