COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-48
DISPLAY
identifier
is the identifier of any data item except an index data item.
literal
is a literal or figurative constant name.
mnemonic-name
is the device on which the process displays the data. You must define mnemonic-
name in the SPECIAL-NAMES paragraph of the Environment Division. When you
omit mnemonic-name, the process delivers the data to its output file, typically its
home terminal.
NO ADVANCING
specifies that the device to which the display is directed is not reset to the next line
after the data is displayed.
The DISPLAY statement in Example 9-3 delivers an error message to the output file of
a process.
If INVOICE-NUMBER is 00246, the output from the code in Example 9-3 looks like this:
I-O ERROR 23 - NO RECORD FOR KEY = 00246
Usage Considerations:
Differences in the OSS and Guardian Environments
In the OSS environment (but not in the Guardian environment), if a DISPLAY
statement includes mnemonic-name, it must be either the OSS pathname of a
Guardian file or the name of an OSS text file.
Devices
The devices to which the DISPLAY statement can transmit data are terminals
(including the operator’s console), printers, processes (including spooler
collectors), and entry-sequences files. Once the DISPLAY device is assigned, the
program cannot change it. The WRITE statement is recommended for all but the
smallest amounts of data.
Example 9-13. DISPLAY Statement
IF IO-STATUS = "23"
DISPLAY "I-O ERROR " IO-STATUS
" - NO RECORD FOR KEY = " INVOICE-NUMBER
END-IF