COBOL Manual for TNS/E Programs (H06.03+)
Printer and Spooler Output
HP COBOL Manual for TNS/E Programs—520347-003
30-8
Spooling Program Output
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.
Level-2 Spooling
You use level-2 spooling the way you use level-1 spooling, except that instead of
opening the output file with the OPEN statement, you open it with the routine
COBOL_SPECIAL_OPEN_ , giving the first parameter, open-type, the value 1, and
either omitting the parameter level-3 or giving it the value 0.
Example 30-1. Level-1 Spooling
SELECT SPOOLER-FILE
ASSIGN TO "$S.#MYSTUF"
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.
...
FD SPOOLER-FILE
RECORD CONTAINS 80 TO 132 CHARACTERS
LABEL RECORDS ARE OMITTED.
01 SPOOLER-SHORT-LINE PIC X(80).
01 SPOOLER-LONG-LINE PIC X(132).
...
PROCEDURE DIVISION.
...
OPEN OUTPUT SPOOLER-FILE
...
WRITE SPOOLER-SHORT-LINE
...










