Spooler Programmer's Guide
Using the Spooler Interface Procedures
Spooler Programmer’s Guide—522287-002
2-24
Spooling—Levels 1 and 2
! Checkpoint call to SPOOLSTART (in this example none of the
! parameters to SPOOLSTART have been computed so this checkpoint
! is not necessary, but most practical programs would need this
! checkpoint).
CALL CHECKPOINT( location);
! Call SPOOLSTART to specify job's attributes
! location #LPRMT3
! form name blanks (default)
! report name user's name and group name (default)
! number of copies 1 (default)
! page size 40
! flags
! hold off
! holdafter on
! NonStop bit off
! priority 7
sperrnum := SPOOLSTART(collectnum,,location,,,,
40,%B0000000000100111);
! Test for an error from SPOOLSTART
If sperrnum THEN CALL sperror(sperrnum);
! Get a line of data and test for done.
! If done, fall through.
WHILE getline(line, length) DO
BEGIN
! Increment sync depth counter and test for
! sync depth overflow
chcount := chcount + 1;
IF chcount = 5 THEN
BEGIN
! Checkpoint the stack (including line of data)
! and synchronization block. Reset sync count.
CALL CHECKPOINT( line, , collectnum);
chcount := 1;
END;
! Write the line to the collector and test for errors
CALL WRITE ( collectnum, line, length);
IF <> THEN CALL error;
END;
! Close the file to the collector
CALL CLOSE(collectnum);
IF <> THEN CALL error;
! Stop backup and stop primary
CALL cherror (0);
CALL STOP;
END;
Example 2-6. Annotated Example of Level-2 Spooling From a NonStop Process
Pair With a Nonzero Sync Depth
(page 4 of 4)