COBOL Manual for TNS and TNS/R Programs
Printer and Spooler Output
HP COBOL Manual for TNS and TNS/R Programs—522555-006
30-19
Skipping Lines
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.
Skipping to a Printer Control Tape Channel Punch
If you are writing to a printer that has a VFU control feature, handled either by punched
paper tape or an electronic equivalent, you can specify that the printer is to advance to
a certain vertical position before (or after) the record delivered by the WRITE statement
is written on the paper. To do this, you must:
•
Know what channels are defined for the printer
•
Use the SPECIAL-NAMES paragraph of the Environment Division to associate
your own mnemonic name with the channel you plan to use
•
Use a BEFORE or AFTER ADVANCING phrase having that mnemonic name
So, if you have a printer on which a skip to channel 6 puts you at line 50 of a page,
your program must specify something like:
SPECIAL-NAMES.
CHANNEL-6 IS CH-6.
Then the WRITE statement to print the contents of record SUBTOTAL-Z on line 50 of
the current page is:
WRITE SUBTOTAL-Z AFTER ADVANCING CH-6