DISPLAY . . . UPON Statement COBOL

The DISPLAY . . . UPON statement causes individual data items to be displayed on an appropriate hardware device.

Format 1:Display Upon System-Name

Display Upon System-Name

The DISPLAY statement transfers the contents of each sending operand, identifier-1 or literal-1 to the hardware device in the order listed.

In a Format 1 DISPLAY statement, the contents of the data item referred to by identifier-1 or the value of literal-1 is transmitted to the standard output device. The presence of the UPON phrase may affect which output device is used.If mnemonic-name-3 is used in the UPON phrase, it must have been defined in the SPECIAL-NAMES paragraph of the Environment Division with the low-volume-I-O-name-1 IS mnemonic-name-3 clause.The associated low-volume-I-O-name-1 must be CONSOLE or SYSOUT.

The size of a data transfer is determined at program execution time; see the RM/COBOL User’s Guide for details. If the size of the data item being transferred is not the same as that determined, one of the following applies:

  1. If the size of the data item being transferred exceeds the determined size, the data beginning with the leftmost character is displayed aligned to the left on the terminal screen for a length of the determined size, and then this rule is reapplied to the remaining characters to the right until all the data has been transferred.
  2. If the size of the data item being transferred is less than the determined size, the transferred data is displayed aligned to the left on the terminal screen.

When the DISPLAY statement contains more than one operand, the size of the sending item is the sum of the sizes of the operands, and the values of the operands are transferred in the sequence in which the operands are encountered without modifying the positioning of the cursor between the successive operands.

If the WITH NO ADVANCING phrase is not specified, the positioning of the standard output device is reset to the leftmost position of the next line following the transfer of the last operand of the DISPLAY statement.

If the WITH NO ADVANCING phrase is specified, the standard output device remains positioned at the character position immediately following the last character of the last operand displayed. DISPLAY . . . UPON CONSOLE is treated as if CONSOLE IS CONSOLE was specified in the SPECIAL-NAMES paragraph if CONSOLE has not been otherwise defined.

DISPLAY . . . UPON SYSOUT is treated as if SYSOUT IS SYSOUT was specified in the SPECIAL-NAMES paragraph if SYSOUT has not been otherwise defined.

DISPLAY . . . UPON Statement Examples



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

COBOL Topics