Setting checkpoints

To set checkpoints, use job control statements and use the RERUN clause in the ENVIRONMENT DIVISION. Associate each RERUN clause with a particular COBOL file.

The RERUN clause indicates that a checkpoint record is to be written to a checkpoint data set whenever a specified number of records in the COBOL file have been processed or when END OF VOLUME is reached. You cannot use the RERUN clause with files that are defined with the EXTERNAL attribute.

You can write checkpoint records from several COBOL files to one checkpoint data set, but you must use a separate data set exclusively for checkpoint records. You cannot embed checkpoint records in one of your program data sets.

Restrictions: A checkpoint data set must have sequential organization. You cannot write checkpoints in VSAM data sets or in data sets that are allocated to extended-format QSAM data sets. Also, a checkpoint cannot be taken if any program in the run unit has an extended-format QSAM data set that is open.

Checkpoint records are written in the checkpoint data set defined by a DD statement. In the DD statement, you also choose the checkpoint method:

Single (store single checkpoints)
Only one checkpoint record exists at any given time. After the first checkpoint record is written, any succeeding checkpoint record overlays the previous one.

This method is acceptable for most programs. You save space in the checkpoint data set, and you can restart your program at the latest checkpoint.

Multiple (store multiple contiguous checkpoints)
Checkpoints are recorded and numbered sequentially. Each checkpoint is saved.

Use this method if you want to restart a program at a checkpoint other than the latest one taken.

You must use the multiple checkpoint method for complete compliance with the 85 COBOL Standard.

Checkpoints during sort operations have the following requirements:

  • If checkpoints are to be taken during a sort operation, add a DD statement for SORTCKPT in the job control procedure for execution.
  • You can take checkpoint records on ASCII-collated sorts, but the system-name that indicates the checkpoint data set must not specify an ASCII file.