COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Form Name
If a job must be printed on a specific form, give the job a form name. Each device known to the
spooler can have a form name.
If your installation prints invoices, you might specify INVOICE as the form name for a report. When
the time comes to print the invoices, the operator loads the proper paper forms on the chosen
device and sets the device’s form name to INVOICE. When both the location and form name of
a spooler job match the location and form name of the device, the spooler prints the job. You
probably cannot expect the operator to notice that a job is waiting for a form name to be associated
with a device. Your facility might have a forms schedule for regularly scheduled jobs, but you
would have to alert the operator for other spooler jobs that need special forms.
A form name can have up to 16 characters.
A form name must not:
• Start with a number or a space character
• Contain any special characters or embedded blanks
The default form name is blank (that is, no form name).
When a device has a nonblank form name associated with it, the spooler routes only jobs with
the same form name to that device. When a device has no form name associated with it, the
spooler can route any job with no form name to it.
Using a Spooler
There are two contexts in which you, as an HP COBOL application programmer, use a spooler:
compilation and execution. When you compile an HP COBOL program and produce a listing, it
can go to the spooler. When you execute an HP COBOL program, it can send output to the spooler.
There are three levels of spooling. You interact with the spooler through the PERUSE and
SPOOLCOM processes.
Spooling Compiler Listings
To send your compiler listing to a spooler, specify a spooler collector and location for your OUT
file when you compile your HP COBOL program; for example:
COBOL85 /IN WHIZBANG, OUT $S.#WIZZ/;SYNTAX
The compiler uses level 3 spooling when the OUT file is a spooler collector (device subtype 31).
Spooling Program Output
For its output, an HP COBOL program can use any of:
• Level-1 Spooling
• Level-2 Spooling
• Level-3 Spooling
Level-1 Spooling
Level-1 spooling uses the spooler collector as a simple output file: you assign the COBOL file name
of the output file to a system name that is a spooler collector (with or without a location name) and
operate on the file with the HP COBOL statements OPEN, WRITE, REWRITE, and CLOSE. The
LINAGE clause and the ADVANCING phrase of the WRITE statement work as expected. All
attributes of the spooler job except the location name assume their default values: single copy,
priority 4, report name set to group name followed by user name, and no form name.
Using a Spooler 903










