Spooler Plus Programmer's Guide

Using the Spooler Print Procedures, Print Processes, and
Perusal Processes
Spooler Plus Programmers Guide522293-003
3-10
Outline of the Basic Perusal Process
that allows a user to select a job for scanning and displays pages of the job on the
home terminal. Commands would allow you to display a specific page, skip ahead or
back pages, and so forth. You can implement the “display page” command with the
pagenum parameter of PRINTREAD; you can implement skipping relative to the
present page by calling PRINTINFO to determine the present page number and
computing the desired new page.
You could also use such a job scanner in conjunction with the SPOOLERCOMMAND
utility procedure, giving the job scanner the ability to delete a job (for example, if the
compilation contained too many errors) or to change the location of a job.
Outline of the Basic Perusal Process
The following steps summarize the perusal process:
1. Open a file to the spooler supervisor:
CALL OPEN( cntrlr^name, cntrlr^fnum ); ! must be waited
2. Pass to SPOOLEREQUEST the file number of the supervisor (obtained in Step 1)
and the job number of the job to be accessed. SPOOLEREQUEST returns a
message whose format is identical to the format of the message that the
supervisor sends to a print process to start a new job:
err := SPOOLEREQUEST( cntrlr^fnum, job^num, msg, );
IF err THEN ... ! error occurred
ELSE ... ! successful
3. Call PRINTREADCOMMAND to obtain the name of the data file in which the job is
located. If desired, you can also obtain job attributes. Open the data file:
CALL PRINTREADCOMMAND( msg,,,,,,, data^file,, location );
CALL OPEN( data^file, data^file^fnum );
4. Call PRINTSTART, passing a 560-word job-buffer:
err := PRINTSTART( job^buf, msg, data^filenum );
IF err THEN ... ! PRINTSTART error
ELSE ... ! OK to begin reading the job