Spooler Programmer's Guide

Using the Spooler Interface Procedures
Spooler Programmer’s Guide522287-002
2-5
Summary of Spooling From an Application Program
SPOOLCONTROL, SPOOLCONTROLBUF, and SPOOLSETMODE take the place
of the Guardian file-system procedures CONTROL, CONTROLBUF, and
SETMODE, for level-3 spooling.
SPOOLWRITE compresses and stores the data from several successive calls.
Only when its buffer is full does it write to the spooler.
Applications should issue a top-of-form control at the beginning and end of all jobs.
This ensures that data from two different jobs will not be printed on the same page.
Example of a Level-1 Application Program
You send data to the spooler at level 1 in 3 steps:
1. Open a file to the collector using the Guardian file-system OPEN procedure.
2. Write data to the collector with calls to the Guardian file-system procedures
WRITE[X], CONTROL, CONTROLBUF, and SETMODE. The amount of data
written by a given call might vary.
3. Signal the end of the job by using the Guardian file-system CLOSE procedure to
close the file to the collector. When the collector receives a system message
telling it that the file has been closed, it removes the job from the open state and
places it in the ready state at the appropriate destination.
Example 2-1 is an example of level-1 spooling.