Format 1
DISPLAY src-item displays an individual field to the screen.
DISPLAY { {src-item}
{OMITTED }
[ UPON new-window ]
Remaining phrases are optional, can appear in any order.
AT screen-loc
AT LINE NUMBER line-num
AT {COLUMN } NUMBER col-num
{COL }
{POSITION}
{POS }
WITH SIZE length
WITH NO ADVANCING
{ERASE} [TO END OF] {LINE } (VAX, ICOBOL)
{BLANK} {SCREEN}
{ERASE} [EOS] (RM)
{BLANK} [EOL]
WITH {BELL}
{BEEP}
{UNDERLINED}
{HIGHLIGHT }
{HIGH }
{BOLD }
{LOWLIGHT }
{LOW }
{STANDARD }
WITH {BLINKING}
{BLINK }
{REVERSE-VIDEO}
{REVERSE }
{REVERSED }
SAME
WITH {COLOR } color-val
{COLOUR}
{FOREGROUND-COLOR } IS fg-color
{FOREGROUND-COLOUR}
{BACKGROUND-COLOR } IS bg-color
{BACKGROUND-COLOUR}
SCROLL [UP ] [ BY scrl-num {LINE } ]
[DOWN] {LINES}
OUTPUT {JUSTIFIED} {LEFT }
{JUST } {RIGHT }
{CENTERED}
WITH {CONVERSION}
{CONVERT }
CONTROL cntrl-string
UPON CRT
} ...
Syntax Rules
- Different formats of the DISPLAY statement may be mixed together in one DISPLAY statement, as long as no ambiguity results.
The effect is the same as specifying each DISPLAY statement separately.
- src-item is a literal or data item. It must be USAGE DISPLAY unless the CONVERSION phrase is also specified. Src-item specifies the
data to be displayed.
- new-window is a USAGE HANDLE or PIC X(10) data item.
- Screen-loc is an integer data item or literal containing exactly 4 or 6 digits. It may also be a group item of 4 or 6 characters.
If a numeric item is used, it must be a non-negative integer.
- line-num,
col-num, and
length are numeric data items or literals. They may be non-integer values. You can also specify the value with an arithmetic expression.
- color-val and
scrl-num are numeric data items or literals.
color-val can also be an arithmetic expression, except when used in the Screen Section.
- fg-color and
bg-color are integer literals or numeric data items. They may be arithmetic expressions. See
Common Screen Options for a more detailed discussion of color settings and values.
- cntrl-string is a nonnumeric literal or data item.
- If the UPON phrase is used it must be the first optional phrase specified.
- If the AT phrase is specified, neither the LINE nor the COLUMN phrase may be specified.
- If the COLOR phrase is specified, neither the FOREGROUND-COLOR nor the BACKGROUND-COLOR phrase may be specified.
- IS and "=" are synonymous.
- COLUMN, COL, POSITION, and POS are equivalent.
- BELL and BEEP are equivalent.
- BLANK and ERASE are equivalent.
- HIGHLIGHT, HIGH and BOLD are synonymous.
- LOWLIGHT and LOW are equivalent.
- UNDERLINE and UNDERLINED are equivalent.
- BLINK and BLINKING are equivalent.
- REVERSE-VIDEO, REVERSE, and REVERSED are equivalent.
- CONVERT and CONVERSION are equivalent.
- COLOR and COLOUR are synonymous.
- FOREGROUND-COLOR and FOREGROUND-COLOUR are synonymous.
- BACKGROUND-COLOR and BACKGROUND-COLOUR are synonymous.
- The ERASE phrase has two forms. In VAX COBOL and ICOBOL compatibility modes, the ERASE SCREEN/LINE form must be used. In RM/COBOL
mode, the ERASE EOS/EOL form must be used. This is indicated in the General Format by the symbols
(VAX, ICOBOL) and
(RM)
- You may add
UPON CRT to a Format 1 DISPLAY statement to distinguish it from a Format 9 DISPLAY statement. You need to do this only if you use
the
Ca compiler option.
General Rules
- The DISPLAY statement sends each of its src-items to the video terminal attached to the executing program. If more than one
src-item is specified, each is treated as if it were in a separate DISPLAY statement in the order listed. Note, however, in
VAX COBOL and ICOBOL compatibility mode, NO ADVANCING is automatically implied for each src-item except for the last one.
- The precise action of the DISPLAY statement depends both on the various clauses specified and the compatibility mode that
the compiler is run in. These actions are detailed in the following rules.
- The effects of the various optional phrases are described in Common Screen Options.
- If the OMITTED option is used, then no src-item is sent to the screen. This can be used to cause the action of various optional
phrases without sending any actual data. For example,
DISPLAY OMITTED, BELL will cause the terminal's bell to ring. If a SIZE phrase is specified, then the OMITTED phrase will act like an alphanumeric
src-item of the specified size whose value is identical to the characters located on the screen where the DISPLAY will occur.
This can be used to modify the video attributes of the screen without changing the displayed data. For example,
DISPLAY OMITTED, SIZE 5, REVERSE
will cause the five characters located at the current cursor location to be changed to
reverse-video.
- The DISPLAY statement can be used with the
-Cv IBM DOS/VS COBOL compatibility command line.