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

This option is the same as option 1 except that if the primary process encounters a trap condition, it
enters the DEBUG procedure instead of being terminated abnormally. (For an explanation of traps
and the DEBUG procedure, see the Guardian Programmer’s Guide.)
2
The primary process, rather than the fault-tolerant facility, reads the $RECEIVE file and takes appropriate
action for system messages. In addition, if the primary process encounters a trap condition, it enters
3
the DEBUG procedure. When this option is in force and the backup process fails, the primary process
must re-execute the STARTBACKUP statement to reestablish the backup. (This is considered an advanced
option because it requires direct calls to the operating system. If you use this option, see the information
on interprocess communication and checkpointing in the Guardian Programmer’s Guide.)
Usage Considerations:
When STARTBACKUP Statement Has No Effect
In the OSS environment, or in the Guardian environment when PARAM NONSTOP OFF is
active, the STARTBACKUP statement has no effect.
NONSTOP Compiler Directive
The STARTBACKUP statement can appear in a source program only when the compiler finds
the NONSTOP directive before it finds an Identification Division header (see NONSTOP
(page 558)).
Backup Process and Takeover Points
When the process is qualified to execute as a process pair, successful execution of the
STARTBACKUP statement establishes and initializes a backup process. The STARTBACKUP
statement does not itself establish a valid takeover point; this is a function of the CHECKPOINT,
OPEN, or CLOSE statement.
Code a CHECKPOINT statement after each STARTBACKUP statement so that the new backup
process will have all the data it needs for a possible takeover.
Creation and Maintenance of a Backup Process
Execution of the STARTBACKUP statement assigns a value to the special register
PROGRAM-STATUS, reflecting the success or failure of the creation of the backup process.
PROGRAM-STATUS is a record with two fields, PROGRAM-STATUS-1 and
PROGRAM-STATUS-2:
01 PROGRAM-STATUS.
02 PROGRAM-STATUS-1 PIC X.
02 PROGRAM-STATUS-2 PIC XXX.
Automatic backup process maintenance (for levels below 3) does not take effect until after the
successful execution of a STARTBACKUP statement.
For PROGRAM-STATUS values, see Table 128: Values for PROGRAM-STATUS When
STARTBACKUP Has Option 0, 1, or 2 (page 950) and Table 129: Values for PROGRAM-STATUS
When STARTBACKUP Has Option 3 (page 951).
Unnamed Processes
If the process to which the STARTBACKUP statement applies was not initiated as a named
process (that is, with the NAME option of the RUN command), the STARTBACKUP statement
returns a specific value in the special register PROGRAM-STATUS. In the CRE, the value is
4922; in the non-CRE environment, it is 4013.
STARTBACKUP Options
For most applications, use option 0 or 1. For either of these options, a STARTBACKUP statement
must execute once during the initialization phase of the program (check the outcome of the
STARTBACKUP execution by examining the PROGRAM-STATUS variable). At each successive
checkpoint, the fault-tolerant facility checks the state of the backup process and processor. If
the backup process is inoperable, the fault-tolerant facility re-creates the backup process. If
STARTBACKUP 461