DISPLAY src-item

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

  1. 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.
  2. 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.
  3. new-window is a USAGE HANDLE or PIC X(10) data item.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. cntrl-string is a nonnumeric literal or data item.
  9. If the UPON phrase is used it must be the first optional phrase specified.
  10. If the AT phrase is specified, neither the LINE nor the COLUMN phrase may be specified.
  11. If the COLOR phrase is specified, neither the FOREGROUND-COLOR nor the BACKGROUND-COLOR phrase may be specified.
  12. IS and "=" are synonymous.
  13. COLUMN, COL, POSITION, and POS are equivalent.
  14. BELL and BEEP are equivalent.
  15. BLANK and ERASE are equivalent.
  16. HIGHLIGHT, HIGH and BOLD are synonymous.
  17. LOWLIGHT and LOW are equivalent.
  18. UNDERLINE and UNDERLINED are equivalent.
  19. BLINK and BLINKING are equivalent.
  20. REVERSE-VIDEO, REVERSE, and REVERSED are equivalent.
  21. CONVERT and CONVERSION are equivalent.
  22. COLOR and COLOUR are synonymous.
  23. FOREGROUND-COLOR and FOREGROUND-COLOUR are synonymous.
  24. BACKGROUND-COLOR and BACKGROUND-COLOUR are synonymous.
  25. 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)
  26. 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

  1. 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.
  2. 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.
  3. The effects of the various optional phrases are described in Common Screen Options.
  4. 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.

  5. The DISPLAY statement can be used with the -Cv IBM DOS/VS COBOL compatibility command line.