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

Terminal Input and Output
HP COBOL Manual for TNS/E Programs520347-003
29-15
Logging Program Activity Information to a Terminal
Logging Program Activity Information to a
Terminal
Whenever a process sends a message to the system operator console terminal device
($0), the operating environment can automatically duplicate the message to the
standard log file, which can be a terminal.
If you use the DISPLAY statement to send messages to the console, and therefore to
the standard log file terminal, you must associate a mnemonic name with $0 in the
SPECIAL-NAMES paragraph. This association is established at compilation time. Each
DISPLAY statement transmits characters to a single terminal or device.
If you use the WRITE statement to send messages to the console, and therefore to the
standard log file terminal, you can determine the assignment between the file and the
device in any one of these ways:
During program compilation, through the SELECT clause of the FILE-CONTROL
paragraph
Before program execution, through the ASSIGN or ADD DEFINE command
During program execution, with the COBOL_ASSIGN_ routine.
If your program consists of modules written in different languages, the modules can
share the standard log file terminal.
For more information about mixed-language programs sharing standard files, see the
CRE Programmers Guide.