COBOL Manual for TNS and TNS/R Programs
Printer and Spooler Output
HP COBOL Manual for TNS and TNS/R Programs—522555-006
30-2
Understanding Spoolers
GUARDIAN-ERR contains the file-system error number that specifies the reason the
printer was not available. Typical values for GUARDIAN-ERR are 14 (device does not
exist) and 12 (file in use). If the file is in use, the process can call the operating system
routine DELAY to let some time pass and then try the open operation again.
If the printer is available, the open operation succeeds, and the process can go ahead
and write to the printer. By default, an HP COBOL program opens a printer file with
exclusion mode EXCLUSIVE. All other processes that attempt to write to the printer
are excluded until the process that has the printer open closes it.
Understanding Spoolers
The HP spooler is a set of processes that acts as an interface between the print
devices of a system and the users and their application programs. A spooler receives
output from a process and stores it on disk, queued for delivery to a print process. This
unit of storage is called a job.
Topics:
•
Spooler Components
•
Jobs
For more information on spoolers, see the Spooler Programmer’s Guide.
Spooler Components
The spooler has these components:
•
Supervisor Process
•
Collector Process
•
Print Process
•
SPOOLCOM
•
PERUSE
The two spooler components that you are most likely to use are SPOOLCOM and
PERUSE.
Unlike the supervisor, collectors, and print processes that run continuously and are
named processes, SPOOLCOM and PERUSE are processes you start when you need
one and they usually are not named. Both interact with the supervisor.