HP OpenVMS Systems Documentation |
HP COBOL
|
Previous | Contents | Index |
If you need more columns than physically can fit on a page, you can do the following:
A report that must include totals at the top of the page before the detail lines has three solutions as follows:
The examples in this section apply only to printers that support overprinting.
Sometimes you must underline a column of numbers to denote a total and also underline the total to highlight it:
1234 1122 ---- 2356 ==== |
To print a single underline, use the underscore character and suppress line spacing. For example:
WRITE PRINT-LINE FROM SINGLE-UNDERLINE-TOTAL BEFORE ADVANCING 0 LINES. |
This overprints the underscore (_) on the previous line, underlining the item: 1122. Use the equal sign (=) to simulate double underlines. Note that you must write the equal signs on the next line. For example:
WRITE PRINT-LINE FROM DOUBLE-UNDERLINE-TOTAL AFTER ADVANCING 1 LINE. |
The examples in this section apply only to printers that support overprinting.
To bold an entire line in a report:
For example:
WRITE PRINT-LINE FROM TOTAL-LINE BEFORE ADVANCING 0 LINES. WRITE PRINT-LINE FROM TOTAL-LINE BEFORE ADVANCING 0 LINES. WRITE PRINT-LINE FROM TOTAL-LINE BEFORE ADVANCING 0 LINES. WRITE PRINT-LINE FROM TOTAL-LINE. |
This example produces a darker image in the report. You can use similar statements for characters and words, as well as complete lines. To bold only a word or only a character within a line, you must:
For example:
WRITE PRINT-LINE FROM TOTAL-LINE BEFORE ADVANCING 0 LINES. * * Move spaces over the items in the source print line (TOTAL-LINE) * that are not to be bolded * MOVE SPACES TO ... WRITE PRINT-LINE FROM TOTAL-LINE BEFORE ADVANCING 0 LINES. WRITE PRINT-LINE FROM TOTAL-LINE BEFORE ADVANCING 0 LINES. WRITE PRINT-LINE FROM TOTAL-LINE. |
ACCEPT and DISPLAY statements are used to make low-volume data available to specified devices. You will find the following information useful:
The COBOL language provides two statements, ACCEPT and DISPLAY, for low-volume I/O operations. The ACCEPT and DISPLAY statements transfer data between your program and the standard input and output devices. If you do not use the FROM or UPON phrases, or an environment variable, the default device for ACCEPT is the keyboard and the default device for DISPLAY is the terminal screen.
The FROM or UPON phrases refer to mnemonic names that you can define in the Environment Division SPECIAL-NAMES paragraph. You define a mnemonic name by equating it to a COBOL implementor name; for example, the following clause equates STATUS-REPORT to the device LINE-PRINTER:
LINE-PRINTER IS STATUS-REPORT |
You can then use the mnemonic name in a DISPLAY statement:
DISPLAY "File contains " REC-COUNT UPON STATUS-REPORT. |
The COBOL implementor names in the SPECIAL-NAMES paragraph refer to special HP COBOL environment variables or logical names. Environment variables or logical names do not always represent physical devices.
On the Tru64 UNIX operating system, you can assign an environment variable to a file name as follows:
% setenv COBOL_LINEPRINTER status.lis <> |
On OpenVMS, you can assign a logical name to a file specification using the ASSIGN command (or the DEFINE command, with the arguments in reverse order):
$ ASSIGN [ALLSTATUS]STATUS.LIS COB$LINEPRINTER <> |
If you use an environment variable or a logical name, you must define it appropriately for the ACCEPT or DISPLAY statement to succeed.
On OpenVMS, when you run an application, if input and output are both directed to terminals, they must be directed to the same terminal. If input and output are directed to different terminals, the output terminal is used and the input terminal is ignored. <>
For more information on the logical names or environment variables and the mnemonic names, refer to the SPECIAL-NAMES section in the Environment Division chapter in the HP COBOL Reference Manual.
On OpenVMS, the ACCEPT statement transfers data from the input device to a data item. If you do not use the FROM phrase, the system uses the logical name COB$INPUT if it is defined, otherwise SYS$INPUT. If you use the FROM phrase, it uses the logical name associated with the mnemonic-name in the FROM clause. <>
On Tru64 UNIX, the ACCEPT statement transfers data from the input device to a data item. If you do not use the FROM phrase, the system uses the environment variable COBOL_INPUT if it is defined, or stdin if COBOL_INPUT is not otherwise defined. If you use the FROM phrase, the system uses the environment variable associated with the mnemonic-name in the FROM clause. <>
The following example illustrates the FROM phrase used in conjunction with ACCEPT:
SPECIAL-NAMES. CARD-READER IS WHATS-THE-NAME . . . PROCEDURE DIVISION. . . . ACCEPT PARAMETER-AREA FROM WHATS-THE-NAME. |
On OpenVMS, the DISPLAY statement transfers the contents of data items and literals to the output device. If you do not use the UPON phrase, the system uses the logical name COB$OUTPUT if it is defined, or SYS$OUTPUT if it is not defined. If you use the UPON phrase, the system uses the logical name associated with the mnemonic-name in the FROM clause. <>
On Tru64 UNIX, the DISPLAY statement transfers the contents of data items and literals to the output device. If you do not use the UPON phrase, the system uses the environment variable COBOL_OUTPUT if it is defined, or stdout if it is not defined. If you use the UPON phrase, the system uses the environment variable associated with the mnemonic-name in the UPON clause.
Previous | Next | Contents | Index |