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

If option 3 of the STARTBACKUP statement is specified (that is, if your program monitors the backup
process), then the possible values of PROGRAM-STATUS are as shown in Table 129.
Table 129 Values for PROGRAM-STATUS When STARTBACKUP Has Option 3
First Digit of PROGRAM-STATUS
6543210Statement
YesNoYesYesYesYesYesSTARTBACKUP
YesNoNoNoYesYesYesCHECKPOINT
NoNoNoYesYesYesYesOPEN
NoNoNoNoYesYesYesCLOSE
If the primary process fails and a proper takeover occurs, PROGRAM-STATUS is set to a take-over
status values (such as “01nn ”) when the backup process begins executing. Successive checkpoints
set PROGRAM-STATUS to other values (such as “1000”).
The action your program should take in response to an exception status (a status other than “0000”)
depends upon your application and the location of the error in your HP COBOL program. A
takeover might need special processing. Most of the other status values indicate a program coding
problem or a system configuration problem. Report the latter problem to the appropriate authority
for your system.
How far and whether processing should continue following a nontakeover status is a subject for
careful analysis.
If a checkpoint failure occurs (that is, status “1000”, “2nnn , or “3nnn ”), the backup process
might remain in an invalid state; therefore, the HP COBOL fault-tolerant facility stops the backup
process if such a failure occurs. If the STARTBACKUP option 0, 1, or 2 was specified (signifying
that the HP COBOL fault-tolerant facility is to monitor the backup process), the facility tries to restart
the backup process at the next execution of the CHECKPOINT statement.
If the checkpoint failure persists for 10 restart cycles, the HP COBOL fault-tolerant facility stops
reestablishing a backup process and sets PROGRAM-STATUS to “5000.
Example 317 Key Parts of Fault-Tolerant HP COBOL Program
?NONSTOP
?SAVE PARAM
* Compiler directive specifies that the program is to be
* compiled for execution as a process pair.
FILE SECTION.
FD TEST-FILE
LABEL RECORD IS OMITTED
RECORD CONTAINS 100 CHARACTERS
DATA RECORD IS TEST-REC.
01 TEST-REC.
05 REC-NUM PIC 9(4).
05 ALTKEY-1 PIC X(5).
05 ALTKEY-2 PIC X(5)....
WORKING-STORAGE SECTION.
01 CKPT-DATA.
* This defines pertinent control information that is
* checkpointed to the backup process
05 KEYNUM PIC 9 VALUE 0.
05 CURR-REC PIC 9(4).
05 CR REDEFINES CURR-REC.
10 FILLER PIC XX.
10 CR-1 PIC 9.
10 CR-2 PIC 9.
05 OLD-BASE PIC 9(4).
Fault-Tolerant Facility 951