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]
CHECKPOINTsaves 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 RETURNINGvalue, 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
CHECKPOINTline. If aGIVINGclause 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
-reloadcompiler flag, or by using the-reloadcompiler flag together with the-checkpointcompiler flag, and the<checkpoint prefix>:>cobc –-reload myprogor
>cobc -–reload -–checkpoint <checkpoint prefix>myprog