COBOL Manual for TNS and TNS/R Programs

Fault-Tolerant Processes
HP COBOL Manual for TNS and TNS/R Programs522555-006
32-9
Using the Fault-Tolerant Facility
When your program performs a series of updates to one or more disk files, you can
combine checkpoints to reduce system overhead. Structure your program so that the
series of write operations necessary to update a file are performed in a group. For
each file to be checkpointed in this manner, the sync depth must equal the maximum
number of write operations that occur between checkpoint operations (CHECKPOINT,
OPEN, or CLOSE statements). Then, when a file is about to be updated by performing
that collection of write operations, the file’s sync block and its record areas must be
checkpointed. In any case, ensure the integrity of all data by checkpointing.
Rules for Servers to Follow With Fault-Tolerant Requesters
If a server is handling requests from a requester that is running as a process pair, there
is an important rule for the server to follow for checkpointing between a $RECEIVE
READ-WRITE pair for a nonretryable request. A nonretryable request is a task that
must not be automatically reexecuted if the requesters backup process takes over. For
example, if a failure occurs after a request to deduct taxes from a paycheck is
executed, reexecution would cause double deduction. This operation must be done
only once for each calculation of the taxes; thus, it is a nonretryable request.
The rule for this case is: Have at least one of the CHECKPOINT statements include
the file-name (from name of the file description entry) of the output file assigned to
$RECEIVE—the file-name with which the write operation is associated.
Using the Fault-Tolerant Facility
To use the fault-tolerant facility, your source program must include a NONSTOP
directive and STARTBACKUP and CHECKPOINT statements and its process must
have a name.
Topics:
NONSTOP Directive
STARTBACKUP and CHECKPOINT Statements
OPEN and CLOSE Statements
PROGRAM-STATUS Data Item
NONSTOP Directive
To enable the fault-tolerant facility, you must specify the NONSTOP directive before the
Procedure Division of the first program unit in the source text.
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.