Restarting during Stringing Phase

Note: This process can be used only with ALGOL programs. It cannot be used with COBOL programs.

Restarting during the stringing phase—while SORT is still reading input records—requires special consideration. If SORT has been passed a file, either a seek is performed or records are read until the desired restart point is reached. However, an input procedure presents a different problem because the program must find the proper restart record. To be able to locate the proper restart record, SORT places values in the first word of the array passed to the input procedure.

The values are negative or positive integers in binary form or 0 to indicate that nothing special is happening. A positive integer is placed in the first word (word 0) to tell the input procedure the relative number of the next record desired by SORT. For example, if SORT has previously processed and saved 99 records, it requests record number 100. A positive nonzero integer occurs in the first word only once, on the first call to the input procedure.

SORT places a negative nonzero integer in the first word to inform the input procedure that SORT has just established a restart point. The absolute value of the number returned represents the number of records saved by SORT. This information can be used by the program to establish its own separate restart points.