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

Terminal Input and Output
HP COBOL Manual for TNS/E Programs520347-003
29-8
Sharing a Terminal
Sharing a Terminal
For development, you normally use a terminal that is associated during system
generation with a command interpreter (such as TACL). That command interpreter
uses your terminal as its IN file, its OUT file, and its home terminal.
Most terminals on a production system do not have command interpreters associated
with them. Each production terminal is directly associated with a production process,
either as a terminal running under the control of a Pathway/TS terminal control process
(TCP) or as a terminal that can be accessed by a process.
Topics:
Terminal Associated With a Command Interpreter
Terminal Not Associated With a Command Interpreter
Non-COBOL Modules
Terminal Associated With a Command Interpreter
When a command interpreter has a terminal open for its IN and OUT file, an
HP COBOL process can open that terminal as a file only if it opens it for shared access
(the default). It cannot open such a terminal for exclusive access, even if the command
interpreter does not accept messages from or send messages to that terminal for the
duration of the HP COBOL process’s execution. If you want an HP COBOL process to
have exclusive use of a terminal, no command interpreter can have the terminal open.
To free a terminal that is running TACL for use as a file by an HP COBOL program,
enter the TACL command PAUSE.
Terminal Not Associated With a Command Interpreter
When a terminal is not connected to a command interpreter, an HP COBOL process
can open it, read from it, write to it, or close it like any other file. See Using a Terminal
as a File.
Non-COBOL Modules
If your program consists of modules written in different languages, the modules can
share the standard files—the predefined files called “standard input,” “standard output,”
and “standard log.”. The standard input, output, and log file can be a terminal.
For more information about mixed-language programs sharing standard files, see the
CRE Programmers Guide.