COBOL Manual for TNS and TNS/R Programs

Terminal Input and Output
HP COBOL Manual for TNS and TNS/R Programs522555-006
29-15
Logging Program Activity Information to 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 COBOLASSIGN routine (in the non-CRE
environment) or the COBOL_ASSIGN_ routine (in the CRE).
If your program consists of modules written in different languages, the modules can
share the standard log file terminal (except FORTRAN modules, because FORTRAN
does not support a standard log file).
If you want to do mixed-language programming, compiling your program to run in the
CRE is highly recommended. Although mixed-language programming is possible in the
non-CRE environment, it is very limited because of incompatibilities between different
languages’ run-time libraries. The CRE supports the languages HP C, HP COBOL,
FORTRAN, Pascal, and TAL. For more information about the CRE in general and on
mixed-language programs sharing standard files in particular, see the CRE
Programmers Guide.