Spooler Plus Programmer's Guide
Using the Spooler Interface Procedures
Spooler Plus Programmer’s Guide—522293-003
2-12
Summary of Spooling From an Application Program
?SOURCE $SYSTEM.SYSTEM.EXTDECS (OPEN, CLOSE, WRITE, STOP, ?SPOOLSTART,
SPOOLWRITE, SPOOLEND)
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;
?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
line [0:39],
! contains the line of data to spool
length,
! contains the number of bytes to write from line
collectnum,
! contains the file number returned from OPEN
location [0:7] := "#LPRMT3 ",
! contains the new location for the job
sperrnum,
! receives SPOOLSTART error code
.buffer[0:511];
! this is the level-3 buffer
! Open file to collector, and check for errors.
Example 2-3. Annotated Example of Level-3 Spooling (page 2 of 3)