Specifying the RERUN clause (format 2) causes special checkpoints to be issued for sort files. Checkpoint records contain information concerning the status of the sort operation. They are necessary in order to enable a program which has been interrupted by the user or because of a computer malfunction to be restarted without having to repeat the entire program run up to that point. The taking of sort checkpoints is especially recommended when dealing with large quantities of sort data, because a successful presort will then not be lost in the event of an abnormal program termination.
Format 2 of the RERUN clause:
RERUN ON implementor-name EVERY SORT OF sort-file-name
implementor-name: SYSnnn (000 <= nnn <= 200)
Checkpoint records are written to a checkpoint file (see chapter "Program linkage") which is created by the sort program using the default file name SORTCKPT.Dyyddd.Tnnnn
(where yy = year, ddd = current day of the year, nnnn = task sequence number of the current task) and the standard link name SORTCKPT (see “Sort” manual [6]). Using the SPACE operand in the SUPPORT parameter of the MODIFY-FILE-ATTRIBUTES command, the user can independently determine the size of this file. Checkpoint output is logged on SYSOUT (message E301; see chapter "Program linkage"). The timing of the checkpoint output cannot be determined by the user independently.
When the sort operation terminates normally, the checkpoint file is closed, released and deleted, i.e. the user has no access to it.
If a sort program is terminated abnormally, program execution can be resumed from the last checkpoint taken. To do this, the user issues a RESTART-PROGRAM command which makes use of the information logged on SYSOUT. See chapter "Checkpointing and restart" and “Commands” manual [3].