RESTART Parameter Values

SORT inspects various bits of the restart parameter to determine the action it is to take. You must supply proper file title attributes for the two disk work files if these files were previously file-equated. Individual bits and combinations of bits can be set by the program to control SORT. RESTART Parameter Values shows the bits and their meanings.

Table 72. RESTART Parameter Values

Bit Number

Explanation

0

If Bit 0 is ON, the program restarts a previous sort operation. SORT tries to open its two disk files and obtain restart information. After successfully obtaining this information, SORT continues from the last known restart point.

If Bit 0 is OFF, SORT starts from the beginning. If the sort operation is restartable and previous sort files with identical titles exist, these sort files are removed and replaced by new sort files.

1

If Bit 1 is ON, the program requests a restartable sort operation. SORT saves its two internal files and can be restarted on program request. If bit 2 is ON, bit 1 is set by default.

If Bit 1 is OFF, A normal sort operation is requested, and no sort files are saved (unless bit 2 is on, which sets bit 1 by default).

2

If Bit 2 is ON, the program requests a restartable sort and desires extensive recovery from I/O errors. With this option set, if I/O errors occur while accessing either of the two sort files, SORT attempts to backtrack and remerge strings as necessary. To use this option, the program must provide at least three times as much disk space as required to contain the input data. When less space is provided, SORT emits the message “CHANGE TO RESTARTABLE ONLY MODE” and continues the sort without further capability to backtrack.

When Bit 2 is OFF, recovery from internal errors is not requested.

3

Bit 3 has meaning only if a restartable sort operation is requested. This option controls SORT during the stringing phase as your input is being read by SORT. Use of this bit determines how SORT restarts—when a restart is requested—if the restart occurs while SORT is in the stringing phase.

If Bit 3 is ON, the SORT is to restart at the beginning of your input. This restart is the equivalent of starting an entirely new sort. In case the restarted sort operation had passed from the stringing phase into the merge phase, it continues from the merge phase. This bit can be set during a restart even if it was not initially set. Once set, it cannot be reset by subsequent restarts.

If Bit 3 is OFF, the SORT is to restart at the last restart point that occurred during the stringing phase. If SORT is still in the stringing phase, it skips over the records already processed and continues from the last restart point. Refer to “Restarting During Stringing Phase” for more information about this process. If SORT is in the merging phase, it continues from the last merge phase restart point. Not setting the bit is normally less efficient than setting the bit because more strings are created during the stringing phase.

4

This bit is reserved for expansion and is not currently used by SORT.


Parameter Values that Combine Bits 0 through 4

When a program is initially starting a sort operation and desires restart ability the restart value should be set as follows:

  • Decimal 2 (bit 1 ON) if a restartable sort operation that is capable of restarting at any point during the stringing or merge phase is desired.

  • Decimal 10 (bits 1 and 3 ON) if a restartable sort operation that can restart at any point during the merging phase but only at the beginning of the stringing phase is desired.

  • Decimal 4 or 6 (bit 2 ON or bits 1 and 2 ON) if a restartable sort operation that can attempt extensive recovery from internal sort I/O errors and can restart at any point during the stringing or merge phase is desired.

  • Decimal 12 (bits 2 and 3 ON) or Decimal 14 (bits 1, 2, and 3 ON) if a restartable sort operation that can attempt extensive recovery from internal sort I/O errors and can restart at any point during the merging phase but only at the beginning of the stringing phase is desired.

  • Decimal 1, 3, 5, or 7—significant bits are bit 0 ON and bit 3 OFF—if a previously incomplete sort operation that can be restarted is desired. The prior incomplete sort must have been capable of restart, and the two sort disk files must be present. A restart is attempted using the values obtained from the sort files. The previous setting of bit 3 controls the sort if it is restarted during the stringing phase. The previous values of bits 1 and 2 are used.

  • Decimal 9, 11, 13, or 15 (significant bits are bits 0 and 3 ON) if a restart of a previously incomplete sort is desired, and if a restart from the beginning of input is desired during the stringing phase. The prior incomplete sort must have been capable of restart, and the two sort disk files must be present. A restart is attempted using the values obtained from the sort files. Bit 3 is set and remains set through all subsequent restarts. Bits 1 and 2 take on their previous values.

  • Decimal 0 or 8—no bits ON or bit 3 ON—causes the sort operation to perform a normal sort with no restart capability.