Spooler Plus Programmer's Guide

Using the Spooler Interface Procedures
Spooler Plus Programmers Guide522293-003
2-29
Spooling—Level 3
?list
PROC root MAIN;
BEGIN
! Declarations
INT collector [0:11] := "$S #LP3 LP3 ",
! contains the file name of the collector and
! location in internal format
collectnum,
! contains the file number returned from OPEN
location [0:7] := "#LPRMT3 ",
! contains the new location for the job
flags := %B0100100000000000,
! contains the bit pattern for the flags parameter to OPEN
! and CHECKOPEN
line [0:39],
! contains the line of data to spool
length,
! contains the number of bytes to write from line
err,
! contains the CHECKOPEN back error or the CHECKPOINT
! status word
sperrnum,
! receives spooler error code
.buffer[0:511],
! this is the level 3 buffer
bytecount;
! contains the number of bytes written to the buffer
! Open file to collector, and check for errors.
CALL OPEN( collector, collectnum, flags);
IF <> THEN CALL error;
! CHECKOPEN successful open of the collector
CALL CHECKOPEN(collector,collectnum, flags,,,, err);
! Check for a CHECKOPEN error
IF <> THEN CALL cherror(err);
! 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
Example 2-7. Annotated Example of Level-3 Spooling From a NonStop Process
Pair With a Zero Sync Depth
(page3of4)