<restart specifications>
── [ ── RESTART ── = ──<arithmetic expression>── ] ────────────────────┤
The restart specifications allow the sort intrinsic to resume processing at the most recent checkpoint after discontinuation of a program. The program must provide logic to restore and maintain variables, arrays, files, pointers, and so forth, which are defined for, and by, the program. In other words, the program must provide the means to restore everything that is necessary for the program to continue from the point of interruption. The restart capability is implemented only for disk sorts.
The sort intrinsic inspects the least significant (rightmost) five bits of the value of the arithmetic expression in the restart specifications to determine the course of action it is to take. To control the sort, these bits can be set by the program. The meanings of these bits are explained in the following table.
|
Bit |
Value |
Description |
|
0 |
1 |
The program is restarting a previous sort. The sort intrinsic tries to open its two disk files and obtain restart information. If it is successful in obtaining this information, the sort intrinsic tries to continue from the most recent restart point. |
|
0 |
0 |
The sort is starting from the beginning. If the sort is restartable, and previous sort files with identical titles exist, they are removed and replaced by new sort files. |
|
1 |
1 |
The program is requesting a restartable sort. The sort intrinsic saves its two internal files and can be restarted on program request. If bit 2 is 1, bit 1 is set to 1 by default. |
|
1 |
0 |
A normal sort is requested, and no sort files are saved (unless bit 2 is 1, which sets bit 1 to 1 by default). |
|
2 |
1 |
The program is requesting a restartable sort and desires extensive error recovery from I/O errors. If bit 2 is 1, the sort intrinsic attempts to backtrack and remerge strings, as necessary, when I/O errors occur during the accessing of either of the two sort files. To use this option, the program must provide at least three times as much disk space as required to contain the input data. If less disk space is provided, the sort intrinsic emits an error message, changes to restartable-only mode, and continues the sort without further use of backtracking capability. |
|
2 |
0 |
Recovery from internal errors is not requested. |
|
3 |
-- |
Bit 3 has meaning only if a restartable sort is requested. The use of this option controls the sort during the stringing phase as the user input is being read by the sort intrinsic. Use of this bit determines how the sort restarts (when a restart is requested) only if the restart occurs while the sort is in the stringing phase. |
|
3 |
1 |
The program requires that the sort restart at the beginning of the user input. This restart is the equivalent of starting an entirely new sort. In case the restarted sort passes from the stringing phase into the merge phase, it continues from the merge phase. This bit can be set to 1 during a restart, even if it is not 1 initially. Once set to 1, it cannot be set to 0 by subsequent restarts. |
|
3 |
0 |
The program requires the ability to restart at the last restart point that occurred during the stringing phase. If the sort is still in the stringing phase, it skips over the records already processed and continues from the last restart point. If the sort is in the merge phase, it continues from the last merge phase restart point. If bit 3 is 0, the sort is normally less efficient because more strings are created during the stringing phase. |
|
4 |
-- |
This bit is reserved for expansion and is not currently used by the sort intrinsic. |

