Spooler Plus Programmer's Guide
Using the Spooler Interface Procedures
Spooler Plus Programmer’s Guide—522293-003
2-11
Summary of Spooling From an Application Program
Example 2-3. Annotated Example of Level-3 Spooling (page 1 of 3)
! This program is an example of level-3 spooling. It consists of 4 
! procedures: error, sperror, getline, and root, and it calls the 
! Guardian procedures OPEN, CLOSE, and STOP. It uses the 
! spooler interface procedures SPOOLSTART, SPOOLWRITE, and SPOOLEND 
! to spool the job.
! 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.
! getline --this procedure returns a line of data for spooling. 
! It is an INT procedure that returns a zero (FALSE) value when 
! it has no data to spool. It has two parameters: line and 
! length. line is a reference to a 40-word (80-byte) array. 
! The array is filled with the line of data to be spooled. 
! length is a reference to an INT that is set to the number of 
! bytes to be written from line.
! root --this is the main procedure. It performs all the file 
! management to the collector and calls the other procedures in 
! the program as needed.
?nolist
INT counter := 0;










