Spooler Plus Programmer's Guide
Using the Spooler Interface Procedures
Spooler Plus Programmer’s Guide—522293-003
2-23
Spooling—Levels 1 and 2
 IF counter > 120 THEN done := 0 ELSE done := 1;
 counter := counter + 1;
 RETURN done;
 END;
?list
PROC root MAIN;
BEGIN
 ! Declarations
 INT collector [0:11] := "$S #LP3 LP3 ",
 ! contains the collector and location name in
 ! internal format
 collectnum,
 ! contains the collector's file number returned from OPEN
 flags := %B0100100000000000,
 ! contains the bit pattern for the flags parameter to OPEN 
 ! and CHECKOPEN
 location [0:7] := "#LPRMT3 ",
 ! contains the job's new location
 line [0:39],
 ! contains the line of data to spool
 length,
 ! contains the number of bytes to write from line
 chcount := 0,
 ! contains the number of uncheckpointed writes pending
 err,
 ! contains the CHECKOPEN back error or the CHECKPOINT 
 ! status word
 sperrnum;
 ! receives SPOOLSTART error code
 ! Open file to collector
 ! flags
 ! receive messages on
 ! access mode write only
 ! open process nowait off
 ! exclusion mode shared
 ! wait/nowait wait
 ! sync depth 5
 CALL OPEN( collector, collectnum, flags, 5);
 ! Check for errors
 IF <> THEN CALL error;
 ! CHECKOPEN the successful open to the collector
 CALL CHECKOPEN(collector,collectnum, flags, 5,,, err);
 ! Check for a CHECKOPEN error
 IF <> THEN CALL cherror(err);
Example 2-6. Annotated Example of Level-2 Spooling From a NonStop Process 
Pair With a Nonzero Sync Depth
(page 3 of 4)










