Compaq AAQ2G1FTK Marine Radio User Manual


 
Using ACCEPT and DISPLAY Statements for Input/Output and Video Forms
11.1 Using ACCEPT and DISPLAY for I/O
On the OpenVMS Alpha operating system, 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, see the SPECIAL-NAMES section in the Environment Division
chapter in the Compaq COBOL Reference Manual.
ACCEPT Statement
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 and Windows NT, 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 (the
keyboard on Windows NT systems) 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.
DISPLAY Statement
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 and Windows NT, 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 (the terminal screen on Windows NT) 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.
112 Using ACCEPT and DISPLAY Statements for Input/Output and Video Forms