Spooler Plus Programmer's Guide
Using the Spooler Interface Procedures
Spooler Plus Programmer’s Guide—522293-003
2-31
Spooling—Level 3
Spooling With a Nonzero Sync Depth
In this type of spooling, you must specify the sync depth when you open the collector
and set bit 11 of flags in SPOOLSTART. Your program need not perform a
checkpoint each time SPOOLWRITE, SPOOLSETMODE, SPOOLCONTROL, or
SPOOLCONTROLBUF returns an error code of %11000. You should perform a
checkpoint each time the number of writes performed since the last checkpoint equals
the sync depth. When you do checkpoint data, the following information should be
checkpointed:
The data stack
The level-3-buffer (the number of bytes of level-3-buffer containing
valid data is returned in the bytes-written-to-buffer parameter of the
SPOOLWRITE, SPOOLSETMODE, and SPOOLCONTROL procedures)
The data line that caused the %11000 return
Example 2-8 is an example of level-3 spooling from a NonStop process pair with a
sync depth greater than zero.
Example 2-8. Annotated Example of Level-3 Spooling From a NonStop Process
Pair With a Nonzero Sync Depth
(page 1 of 5)
! This program is an example of level-3 NonStop spooling with a
! sync depth of 3. It consists of 6 procedures: cherror,
! stbackup, error, sperror, getline, and root, and it calls the
! Guardian procedures OPEN, CLOSE, STOP, CHECKOPEN, and
! CHECKPOINT. It uses the spooler interface procedures SPOOLSTART,
! SPOOLWRITE, and SPOOLEND to spool the job.
! cherror --this procedure handles checkpointing errors.
! It performs the necessary steps for recovery or it aborts the
! program. It has a single INT parameter that is the back error
! returned from CHECKOPEN or the status word returned from
! CHECKPOINT. If it is called with a 0 value, it will stop the
! backup process.
! stbackup --this procedure decides whether this program is the
! primary or backup procedure. If it is the primary, it starts a
! backup. Otherwise, it waits for checkpointing information from
! the primary.
! error --this procedure handles I/O errors. It performs the
! necessary steps for recovery or it aborts the program.
! sperror --this procedure handles spooler errors. It performs
! the necessary steps for recovery or it aborts the program.
! It has a single INT value parameter that is the error code
! returned from the spooler interface procedures.