Spooler Plus Programmer's Guide
Using the Spooler Interface Procedures
Spooler Plus Programmer’s Guide—522293-003
2-34
Spooling—Level 3
! 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 new job attributes and level-3
! buffer
! 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 on
! priority 7
sperrnum :=
SPOOLSTART(collectnum, buffer, location,,,, 40,
%B0000000000110111);
! 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
! Write line to collector and check for errors
sperrnum := SPOOLWRITE (buffer, line, length);
! If buffer is ready to be written to collector
! call CHECKPOINT then write buffer
IF sperrnum = %11000 THEN
BEGIN
!Increment sync depth counter and check for overflow
syncount := syncount + 1 ;
IF syncount = 3 THEN
BEGIN
err := CHECKPOINT(line, buffer, bytecount,,collectnum);
IF err THEN CALL cherror(err);
syncount := 1
END;
Example 2-8. Annotated Example of Level-3 Spooling From a NonStop Process
Pair With a Nonzero Sync Depth
(page 4 of 5)