Spooler Programmer's Guide
Using the Spooler Print Procedures, Print
Processes, and Perusal Processes
Spooler Programmer’s Guide—522287-002
3-3
External Declarations for Print Procedures
6. The print process now reads the job, one line at a time, by a series of calls to
PRINTREAD, and writes each line to the device until an end of file is returned.
7. The print process informs the supervisor that the job is complete by calling
PRINTSTATUS.
8. If the device is shared, the supervisor sends a “close device” indication to the print
process. The print process closes the device and calls STOP.
In addition to the above action, the print process periodically calls AWAITIO[X] to check
for an incoming message from the spooler supervisor. Such a message might indicate
the start of another job (if the print process is capable of handling multiple concurrent
jobs) or an instruction requiring specific action on the part of the print process, such as
“skip to page 17” or “stop job.”
Errors occurring on the device are sent by the print process to the supervisor by using
the PRINTSTATUS command.
The details of the interaction between the spooler supervisor and a print process are
described later in this section.
External Declarations for Print Procedures
To use the print procedures in a TAL program, you must declare them to be external to
your program. The external declarations for all procedures related to the spooler,
including the print procedures, are located in the file $SYSTEM.SYSTEM.EXTDECS0.
They can be sourced into your program with the following compiler command:
?SOURCE $SYSTEM.SYSTEM.EXTDECS0 ( PRINTSTART , PRINTINIT ,
? PRINTINFO , PRINTCOMPLETE , PRINTREADCOMMAND ,
? PRINTSTATUS , PRINTREAD )
See the TAL Reference Manual for a full explanation of the EXTERNAL procedure
declaration and the ?SOURCE compiler directive.
Writing a Print Process
The following pages discuss the considerations associated with writing your own print
process. Appendix A, Sample Print Process
, contains an example of a user-written
print process.
A print process must perform three tasks:
1. Read the Startup message.
2. Retrieve and print spooled data (using PRINTSTART and PRINTREAD).
Note. Be aware that when some devices (notably drum printers) encounter a non-ASCII
character, the printer can lock up unless you specified CTRLTOSPACE in the system
generation configuration for the printer. Refer to the appropriate system generation
manual for more information.