COBOL/400 Language Help

Format 3 (Workstation I/O)

Description
Format 3 of the DISPLAY statement (also known as the extended DISPLAY statement) provides output support for workstation I/O.

An extended DISPLAY statement has one of the following:

A DISPLAY statement is not an extended DISPLAY statement if it:

Format 3 (Workstation I/O)
 
             *----------------------*
             V                      +
->->--DISPLAY--*-*-identifier-1-*-----*----------------------->
             + *-literal-1----*     +
             +                      +
             *-line-col-phrase------*
             +                      +
             *-UPON-*-CRT-------*---*
             +      *-CRT-UNDER-*   +
             +                      +
             *-MODE--*----*--BLOCK--*
             +       *-IS-*         +
             +                      +
             *-with-phrase----------*
 
where line-col-phrase is:
 
              *--------------------------------------*
              V                                      +
->->--*--*----*-*-LINE--*--------*--*-identifier-2-*---*--*---><-
    +  *-AT-* +       *-NUMBER-*  *-integer-1----*   +  +
    +         +                                      +  +
    +         *-*-COLUMN-*-*--------*-*-identifier-2-*  +
    +           *-COL----* *-NUMBER-* *-integer-1----*  +
    +                                                   +
    *--AT--*-identifier-3-*-----------------------------*
           *-integer-2----*
 
where with-phrase is:
 
          *---------------------------------------------*
          V                                             +
->->--WITH--*-*-BELL-*------------------------------------*---><-
          + *-BEEP-*                                    +
          +                                             +
          *---BLINK-------------------------------------*
          +                                             +
          *---HIGHLIGHT---------------------------------*
          +                                             +
          *---REVERSE-VIDEO-----------------------------*
          +                                             +
          *---UNDERLINE---------------------------------*
          +                                             +
          *---BLANK--*-SCREEN-*-------------------------*
          +          *-LINE---*                         +
          +                                             +
          *---SIZE--*----*--*-identifier-4-*------------*
          +         *-IS-*  *-integer-3----*            +
          +                                             +
          *-*-FOREGROUND-COLOR--*-*----*-integer-4------*
          + *-FOREGROUND-COLOUR-* *-IS-*                +
          +                                             +
          *-*-BACKGROUND-COLOR--*-*----*-integer-5------*
            *-BACKGROUND-COLOUR-* *-IS-*
 

Identifier-1, Literal-1

Identifier-1 and literal-1 are data items whose value may be displayed.

If identifier-1 is a group item and there is no MODE IS BLOCK phrase, those elementary subordinate items that have names other than FILLER are displayed. They are displayed simultaneously, and positioned on the screen in the order that their descriptions appear in the DATA DIVISION, separated by the lengths of the FILLER items in the group. For this purpose, the first position on a line is regarded as immediately following the last position on the previous line. When items are separated by FILLERs, the attribute bytes are included in the FILLER length. Thus a FILLER of one or two bytes would contain both the trailing and leading attributes of separate items. In the case of a one-byte FILLER, the trailing and leading attributes would occupy the same byte. Since data items are normally separated by one attribute byte, one-byte FILLERs are not necessary.

Identifiers or literals in a DISPLAY statement follow one after another, separated by one attribute byte, unless an AT, LINE, or COLUMN phrase is specified. If no AT, LINE, or COLUMN phrase appears in the statement, the first identifier or literal begins at line 1, column 2, followed immediately by all other identifiers or literals.

The phrases following the identifier or literal can be in any order. All phrases specified apply to the previous identifier or literal, if one was specified. The WITH and MODE phrases cannot be specified if an identifier or literal was not previously specified.

If identifier-1 or literal-1 is not specified, neither the MODE IS BLOCK phrase nor the WITH phrase is allowed.

If no identifier or literal is present, the DISPLAY operation changes the screen position without actually displaying any data.

AT

The AT phrase indicates the absolute address on the screen at which the DISPLAY operation is to start. If you do not specify the AT phrase, the DISPLAY operation starts at line 1, column 2. The AT phrase does not indicate the starting position of the leading attribute.

identifier-2 or literal-2

Identifier-2 and integer-1 must be unsigned numeric integers with a value greater than or equal to zero. If the value for LINE or COLUMN is negative, the absolute value is taken.

identifier-3 or integer-2

Identifier-3 must be a PIC 9(4) or a PIC 9(6) field. Integer-2 must be a 4- or 6-byte numeric field. If identifier-3 or integer-2 is 4 digits long, the first 2 digits specify the line, and the second 2 digits specify the column. If identifier-3 or integer-2 is 6 digits long, the first 3 digits specify the line, and the second 3 digits specify the column.

CRT-UNDER or CRT

The UPON CRT/CRT-UNDER phrase indicates that the DISPLAY statement is extended.

CRT-UNDER also underlines the displayed item preceding the UPON CRT-UNDER phrase.

BLOCK or MODE

The MODE IS BLOCK phrase indicates that the identifier is treated as an elementary item; even if it is a group item, it is displayed as one item.

WITH

The WITH phrase allows you to specify options for the DISPLAY operation. If you specify more than one item prior to this phrase, only the item immediately before the phrase is affected by it.

BEEP or BELL

If you specify the BELL phrase, an audible alarm sounds each time the item containing this phrase is displayed.

You can use BELL and BEEP interchangeably.

BLANK, LINE, or SCREEN

BLANK is effective each time the screen item containing the clause displays.

BLANK LINE erases from the current cursor position to the end of the current line. BLANK SCREEN erases the entire screen and places the cursor at line 1.

The erasing is done before the item is displayed.

SIZE

The SIZE phrase specifies the size of the data item on the screen. You can use this phrase with elementary data items only.

The SIZE phrase has no effect if the size you specify is zero. In this case, the length of the field is used to display the data item.

identifier-4 or integer-3

Identifier-4 must be an unsigned numeric integer, and must not be subject to an OCCURS clause. Integer-3 must be unsigned.

If identifier-4 has a sign, the compiler uses the absolute value, and issues a warning message.


[ Top of Page | Previous Page | Next Page | Table of Contents ]