Spooler Programmer's Guide

Introduction to the Spooler Subsystem
Spooler Programmer’s Guide522287-002
1-10
Job States While Spooling From a Program
zeros) is replaced by one word describing the character and the number of words
being compressed. For example, an 80-character line containing all blanks would be
compressed into a single word.
Job States While Spooling From a Program
The term job refers to the data written by an application process to a collector. The
collector creates a job when an application opens a file to it and either issues a
Guardian file-system WRITE[X], CONTROL, CONTROLBUF, or SETMODE procedure
call to the collector, or calls SPOOLSTART.
At this point, the job is in the open state, meaning that the application is sending data
to the spooler.
Spooling is completed either when the application closes the file to the collector or
when an application using the interface procedures calls SPOOLEND.
By using the CONTROL, CONTROLBUF, and SETMODE procedures or the
SPOOLCONTROL, SPOOLCONTROLBUF, and SPOOLSETMODE procedures, the
spooler gives applications complete control of the devices on which their jobs are
printing. For this reason, applications should issue a top-of-form control, using
CONTROL or SPOOLCONTROL, to guarantee the state of the print device before and
after the job has been printed. Otherwise, data from two different jobs could appear on
the same printed page. All software supported by HP performs this step when
spooling a job.
If an application using the interface procedures closes the file to the collector without
first calling SPOOLEND, the job is completed but the collector assumes that an
abnormal termination has occurred and places the job in the hold state.
Collectors
The spooler includes one or more collectors, each of which is a continuously running
copy of the program in $SYSTEM.SYSTEM.CSPOOL. Applications can direct output
from an application program to a collector by treating the collector as their OUT file;
that is, an application can open a file to any collector and begin writing its output using
the Guardian file-system WRITE[X] procedure. Applications can also use the spooler
interface procedures to spool their output (described in Section 2, Using the Spooler
Interface Procedures).
While the spooler is in the cold or warm state, you can declare and initialize the spooler
collectors by using the Spoolcom COLLECT command, specifying attributes such as
execution priority and program file name.
Collector Attributes
Table 1-3 lists the default attributes of collectors and the Spoolcom COLLECT
subcommands used to specify them.