COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

STARTBACKUP and CHECKPOINT Statements
Normally, the STARTBACKUP statement is executed once at the beginning of run-unit execution
(after the opening of the files) to establish a process pair. A CHECKPOINT statement is then executed
at critical points during processing to pass (that is, checkpoint) information to the backup process.
OPEN and CLOSE Statements
If a process is executing as a process pair (that is, the primary process has executed a
STARTBACKUP statement), checkpointing occurs automatically when any OPEN or CLOSE statement
executes and when the backup process is established. The execution of STARTBACKUP and
CHECKPOINT statements sets the PROGRAM-STATUS variable to indicate the outcome of the
checkpointing operation. The execution of OPEN and CLOSE statements (because they establish
takeover points) also sets the PROGRAM-STATUS variable.
Following an OPEN or CLOSE of a file by the primary process, the sync blocks of all other files in
the backup process become invalid. If the SYNCDEPTH exceeds 1, you must checkpoint both the
record and the sync block of each file other than the one that was opened or closed before executing
the next WRITE statement.
PROGRAM-STATUS Data Item
Each HP COBOL run unit contains a four-digit data item called PROGRAM-STATUS, shown in
Example 316. When a process is running as a process pair, this item is set by the HP COBOL
fault-tolerant facility to indicate the outcome of the execution of a STARTBACKUP, OPEN, CLOSE,
or CHECKPOINT statement.
Example 316 PROGRAM-STATUS Data Item
01 PROGRAM-STATUS.
05 PROGRAM-STATUS-1 PIC X.
05 PROGRAM-STATUS-2 PIC X(3).
If one of options 0 through 2 of the STARTBACKUP statement is used (that is, if the HP COBOL
fault-tolerant facility monitors the backup process), then the possible values of PROGRAM-STATUS
for any execution of a STARTBACKUP, CHECKPOINT, OPEN, or CLOSE statement and their
meanings are as shown in Table 128.
Table 128 Values for PROGRAM-STATUS When STARTBACKUP Has Option 0, 1, or 2
MeaningPROGRAM-STATUS Value
No error0000
Takeover by backup, primary stopped0100
Takeover by backup, primary aborted0101
Takeover by backup, primary processor module failed0102
Takeover by backup, primary called CHECKSWITCH0103
Backup processor down1000
Communication error; nnn = file system error number2nnn
CHECKOPEN failure; nnn = file system error number3nnn
Indicates a PROCESS_CREATE_ failure. For more information, see the Guardian Procedure
Calls Reference Manual.
4nnn
Too many failure-restart cycles (takeovers by backup) or a logic error in program5000
Parameter or logic error6000
950 Fault-Tolerant Processes