COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Example 297 Level-2 Spooling
SELECT SPOOLER-FILE
ASSIGN TO "$S"
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS SPOOLER-FILE-STAT....
FD SPOOLER-FILE
RECORD IS VARYING FROM 80 TO 132 CHARACTERS.
01 SPOOLER-SHORT-LINE PIC X(80).
01 SPOOLER-LONG-LINE PIC X(132).
WORKING-STORAGE SECTION.
01 SPOOLER-FILE-STAT PIC XX.
01 LOCATION-NAME PIC X(16) VALUE "#MYSTUF".
01 REPORT-NAME PIC X(16) VALUE "PRIVATE PROPERTY".
* Flag for HOLDAFTER (32), PRIORITY 2 (+2 = 34)
01 FLAGS PIC S9(4) VALUE 34.
01 ERROR-CODE PIC S9(4)....
PROCEDURE DIVISION.
...
ENTER "COBOL_SPECIAL_OPEN_"
USING SPOOLER-FILE
1
OMITTED
OMITTED
OMITTED
0
LOCATION-NAME
OMITTED
REPORT-NAME
OMITTED
OMITTED
FLAGS
GIVING ERROR-CODE...
WRITE SPOOLER-SHORT-LINE...
Level-3 Spooling
Level-3 spooling causes the compiler to block output and minimizes the number of interactions with
the spooler. There are two ways to get level-3 spooling:
• The same way you get level-2 spooling, except that when you open the output file with the
COBOL_SPECIAL_OPEN_ routine, you give the parameter level-3 a nonzero value.
• Instead of using HP COBOL output statements on the file, use ENTER statements to call the
Guardian environment routines listed in Table 125.
Table 125 Guardian Environment Routines for Level 3 Spooling
ActionRoutine
Closes the spooler collectorCLOSE
Opens the spooler collectorOPEN
Handles VFU channel skippingSPOOLCONTROL
Handles the loading of programmable VFU for the model 5220 printerSPOOLCONTROLBUF
Signals the end of a spooler job and can change attributes before a new
spooler job starts without closing and reopening the spooler collector
SPOOLEND
Sets automatic perforation skipping, system spacing control, baud rate,
form length, vertical tabs, automatic-answer or control-answer mode,
SPOOLSETMODE
Using a Spooler 905










