Spooler Programmer's Guide
Using the Spooler Interface Procedures
Spooler Programmer’s Guide—522287-002
2-28
Spooling—Level 3
! 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;
?SOURCE $SYSTEM.SYSTEM.EXTDECS(OPEN, CLOSE, WRITE, STOP, ?SPOOLSTART, 
SPOOLWRITE, SPOOLEND,CHECKOPEN, CHECKPOINT)
PROC cherror (george);
 INT george;
 BEGIN
 CALL STOP;
 END;
PROC stbackup;
 BEGIN
 counter := counter;
 END;
PROC error;
 BEGIN
 CALL STOP;
 END;
PROC sperror (errnum);
INT errnum;
 BEGIN
 CALL STOP;
 END;
INT PROC getline( line, length);
 INT .line,
 .length;
 BEGIN
 INT temp, done;
 temp :=0;
 temp := counter.<13:15> ;
 temp := temp * 5;
 line [0] ':=' " ";
 line [1] ':=' line[0] for 39;
 line [temp] ':=' "0123456789";
 length := 80;
 IF counter > 120 THEN done := 0 ELSE done := 1;
 counter := counter + 1;
 RETURN done;
 END;
Example 2-7. Annotated Example of Level-3 Spooling From a NonStop Process 
Pair With a Zero Sync Depth
(page2of4)










