Skip to content

Guidelines for Use of Checkpoints

COBOL-IT supports the CHECKPOINT verb, which can be used to enable checkpoint processing in programs compiled with the –fcheckpoint compiler flag.

Usage:

CHECKPOINT [checkpoint prefix] CONTINUE [GIVING field]

or

CHECKPOINT [checkpoint prefix] EXIT [RETURNING|WITH] [return value] [GIVING field]

  • CHECKPOINT saves the current status of a program (Field Value, call stack, perform stack) into a file named <checkpoint prefix><program id>.ctx.
  • When used with CONTINUE, the runtime saves the status and continues execution.
  • When used with EXIT RETURNING value, the runtime saves the status, and exits the program (and all calling parent programs) returning the value.
  • When called back with checkpoint file, the runtime reloads the program status and continues the execution at the statement just following the CHECKPOINT line. If a GIVING clause is specified, the field is set to "1" when reloading and to "0" when execution is continuing.
  • Reloading a checkpoint is done by using the -reload compiler flag, or by using the -reload compiler flag together with the -checkpoint compiler flag, and the <checkpoint prefix>:

    >cobc –-reload myprog

    or

    >cobc -–reload -–checkpoint <checkpoint prefix>myprog

Back to top