Compaq COBOL AAQ2G1FTK User Manual

Page 391

Advertising
background image

11

Using ACCEPT and DISPLAY Statements for

Input/Output and Video Forms

ACCEPT and DISPLAY statements are used to make low-volume data available
to specified devices. You will find the following information useful:

Section 11.1 describes the use of the ACCEPT and DISPLAY statements for
interactive I/O.

Section 11.2 explains how you can design an online video form similar to a
printed form by using the Compaq extensions to the ACCEPT and DISPLAY
statements .

Section 11.3 describes the X/Open Screen Section features. You can use it to
design video forms easily and efficiently in a single section of your COBOL
program, and then accept or display a full screen of data with a single
ACCEPT statement or DISPLAY statement.

11.1 Using ACCEPT and DISPLAY for I/O

The COBOL language provides two statements, ACCEPT and DISPLAY, for
low-volume I/O operations. The ACCEPT and DISPLAY statements transfer data
between your program and the standard input and output devices. If you do not
use the FROM or UPON phrases, or an environment variable, the default device
for ACCEPT is the keyboard and the default device for DISPLAY is the terminal
screen.

The FROM or UPON phrases refer to mnemonic names that you can define in
the Environment Division SPECIAL-NAMES paragraph. You define a mnemonic
name by equating it to a COBOL implementor name; for example, the following
clause equates STATUS-REPORT to the device LINE-PRINTER:

LINE-PRINTER IS STATUS-REPORT

You can then use the mnemonic name in a DISPLAY statement:

DISPLAY "File contains " REC-COUNT UPON STATUS-REPORT.

The COBOL implementor names in the SPECIAL-NAMES paragraph refer to
special Compaq COBOL environment variables or logical names. Environment
variables or logical names do not always represent physical devices.

On the Tru64 UNIX operating system, you can assign an environment variable to
a file name as follows:

% setenv COBOL_LINEPRINTER status.lis

Using ACCEPT and DISPLAY Statements for Input/Output and Video Forms 11–1

Advertising