COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

Suppose you have a 100-page report in the spooler and you want to print its last 3 pages on
$LP1. First, use either PERUSE or the SPOOLCOM JOB command to get the job printing on $LP1.
Then use this form of the DEV command:
DEV $LP1, SKIPTO 98
This command tells the spooler to skip forward to page 98 of the job. The skipping capability is
related to the device, not to the job.
Skipping capability is useful is when the printer has jammed or the ribbon failed and ruined part
of your listing. If the spooler delivered 56 pages of the job, but the pages from 50 onward are
not usable, the job’s owner (or the system operator) can take the printer offline, fix the mechanical
problem, put the printer back online, and issue the SPOOLCOM command:
DEV $LP1, SKIPTO 49
For the full syntax of the JOB and DEV commands, see the Guardian User’s Guide. You can often
get the information you need from SPOOLCOM command HELP; for example, this command gives
the syntax and capabilities of the JOB command:
HELP JOB
Controlling Vertical Spacing in a Printed Report
When you write to a printer or to a spooler, you can transmit not only data but also control
information. Control information skips numbers of lines or skips to VFU channels. Some printers
supplied by HP use a punched paper tape to control vertical formatting; others use an electronic
device to perform that function.
The control information is not embedded in each print line but is transmitted separately from your
program to the device or to the spooler collector. The spooler stores the information in a manner
that enables it to generate the same image on paper as would have been generated if your program
had been writing directly to a printer.
You control vertical spacing in a report with the ADVANCING clause of the sequential form of the
WRITE statement.
If you do not use an ADVANCING clause, the WRITE statement behaves as if it contained the
clause AFTER ADVANCING 1 LINE; that is, the printer prints the record in the WRITE statement
after advancing one record.
Skipping Lines
To leave a blank line in your report before printing the record DETAIL-X, use this form of the WRITE
statement:
WRITE DETAIL-X AFTER ADVANCING 2 LINES
To print the record DETAIL-Y and then leave a blank line, use this form of the WRITE statement:
WRITE DETAIL-Y BEFORE ADVANCING 1 LINE
Do not follow the preceding statement with another WRITE AFTER statement, or you will not get a
blank line.
Overprinting Lines
To overprint the record named HEADER-X for emphasis, print it three times on the same line:
WRITE HEADER-X
WRITE HEADER-X AFTER ADVANCING 0 LINES
WRITE HEADER-X AFTER ADVANCING 0 LINES
This sequence also causes overprinting:
WRITE HEADER-X AFTER ADVANCING 0 LINES
WRITE HEADER-X BEFORE ADVANCING 0 LINES
To underline a line, print a string of underscore characters over it.
Controlling Vertical Spacing in a Printed Report 911