[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP COBOL
Reference Manual


Previous Contents Index

Format 1

  1. The DISPLAY statement transfers data from each src-item (in its order of appearance in the statement) to output-dest.
  2. No editing or conversion occurs during DISPLAY execution unless there is an applicable WITH CONVERSION phrase.
  3. If src-item is a figurative constant, only one occurrence is displayed.
  4. When there is more than one src-item, sending item size is the sum of the src-item sizes.
  5. If there is no UPON phrase, the DISPLAY statement transfers data to the default system output device.
  6. If there is no WITH NO ADVANCING phrase, the DISPLAY statement transfers device positioning information. It resets the output-dest position to the leftmost position on the next line.
  7. If DECIMAL POINT IS COMMA is specified, comma replacement occurs upon display.

Format 2

  1. The presence of either the LINE NUMBER phrase or the COLUMN NUMBER phrase implies NO ADVANCING; that is, no line feed or carriage return is generated automatically following data output. The cursor remains on the character position immediately following the position of the last character displayed. This is the default starting position for the next data item you input from or display upon the terminal.
  2. If you specify neither the LINE NUMBER phrase, the COLUMN NUMBER phrase, nor the WITH NO ADVANCING phrase, data is output according to Format 1 positioning rules for the DISPLAY statement. That is, a line feed and carriage return are generated automatically following data display.

LINE NUMBER Phrase (Format 2)

  1. The LINE NUMBER phrase positions the cursor on a specific line of the video screen prior to displaying.
  2. If the LINE NUMBER phrase does not appear but the COLUMN NUMBER phrase does, then data is displayed to the current specified column position.
  3. If line-num or the value of line-id is greater than the bottommost line position of the current screen, program results are undefined.
  4. If you use line-id without its PLUS option, the line position is the value of line-id.
  5. If you use line-id with its PLUS option, the line position is the sum of plus-num and the value of line-id.
  6. If you use the PLUS option without line-id, the line position is the sum of plus-num and the value of the current line position.
  7. If you use the PLUS option, but you do not specify plus-num, then PLUS 1 is implied.
  8. Data output results are undefined if your program generates a value for line-id that is one of the following:
    • Zero
    • Negative
    • Greater than the bottommost line position of the current screen

COLUMN NUMBER Phrase (Format 2)

  1. The COLUMN NUMBER phrase positions the cursor on a specific column of the video screen.
  2. If the COLUMN NUMBER phrase does not appear but the LINE NUMBER phrase does, then data is displayed to column 1 of the specified line position.
  3. If you use column-id without its PLUS option, the column position is the value of column-id.
  4. If you use column-id with its PLUS option, the column position is the sum of plus-num and the value of column-id.
  5. If you use the PLUS option without column-id, the column position is the sum of plus-num and the value of the current column position.
  6. If you use the PLUS option, but do not specify plus-num, PLUS 1 is implied.
  7. Data output results are undefined if the program generates a value for column position that is one of the following:
    • Zero
    • Negative
    • Greater than the last column position on the screen

LINE NUMBER and COLUMN NUMBER Phrases (Format 3)

  1. The LINE NUMBER and COLUMN NUMBER phrases together give the starting screen coordinates.
  2. The position of each screen item within the referenced screen-name is offset from the LINE and COLUMN positions.
  3. If either LINE or COLUMN is not specified, the default value is 1.

ERASE Phrase (Format 2)

  1. The ERASE phrase erases all, or part, of a line (or screen) before displaying data. You must specify SCREEN or LINE.
  2. If you use its TO END option, the ERASE phrase erases the line (or screen) from the implied, or stated, cursor position to the end of the line (or screen).
  3. If you do not use its TO END option, the ERASE phrase erases the entire line (or screen).

BELL Phrase (Format 2)

  1. The BELL phrase rings the terminal bell before displaying data.

UNDERLINED Phrase (Format 2)

  1. The UNDERLINED phrase displays characters on the screen with the underscore on character attribute.

BOLD Phrase (Format 2)

  1. The BOLD phrase displays characters on the screen with the bold on character attribute. The BOLD attribute is only detectable when any of the following conditions are true:
    • Nonspace characters are displayed.
    • The underlined or reversed attributes are specified.
    • The terminal screen is set to light background.

BLINKING Phrase (Format 2)

  1. The BLINKING phrase displays characters on the screen with the blink on character attribute. The BLINKING attribute is only detectable when any of the following conditions are true:
    • Nonspace characters are displayed.
    • The underlined or reversed attributes are specified.
    • The terminal screen is set to light background.

REVERSED Phrase (Format 2)

  1. The REVERSED phrase displays characters on the screen with the reverse video on character attribute.

Formats 4, 5, and 6

  1. When a Format 4 DISPLAY statement is specified, the value stored in arg-position is moved to argument-number. This updates the current argument position indicator for the command line (see ARGUMENT-NUMBER in the SPECIAL-NAMES paragraph in Chapter 4). This points to the selected argument to be read by a Format 7 ACCEPT statement.
  2. arg-position must be in the range 0 to 99 and can refer to arguments, switches, and flags that appear on the run command line of the COBOL program. When the current argument position indicator is zero, it refers to the zeroth command line argument, in other words the command that invoked the COBOL program.
  3. When a Format 5 DISPLAY statement is specified, the value stored in envlog-name is moved to environment-name (see ENVIRONMENT-NAME in the SPECIAL-NAMES paragraph in Chapter 4). The updated value of environment-name becomes the environment variable or logical to be accessed by subsequent Format 6 DISPLAY and Format 8 ACCEPT statements.
  4. environment-value, when used with a Format 6 DISPLAY, receives the value stored in envlog-value. The environment variable or logical is the one named by a Format 5 DISPLAY statement (see ENVIRONMENT-VALUE in the SPECIAL-NAMES paragraph in Chapter 4).
  5. stment is executed if the name of the environment variable or logical has not been set by a Format 5 DISPLAY, or if the environment variable or logical does not exist.
  6. stment2 is executed if the exception condition does not exist.

Technical Notes

Format 1

  1. On OpenVMS, the DISPLAY statement transfers data through the I/O system (RMS), using the Variable with Fixed-Length Control (VFC) format. <>
  2. A DISPLAY statement without the UPON phrase transfers data to the default output device (the terminal). To transfer data to a file on Tru64 UNIX systems, the environment variable COBOL_OUTPUT can be used to specify a text file containing output data. To transfer data to a file on OpenVMS systems the logical COB$OUTPUT or SYS$OUTPUT can be used to specify a text file containing output data.
    Alternatively, output device redirection (>) can be used on Tru64 UNIX systems to name an output file.
  3. A DISPLAY statement that includes the UPON phrase transfers data to the file-device-name associated with the SPECIAL-NAMES paragraph description of output-dest.
  4. Because the object of a logical name (on OpenVMS systems) is not necessarily a device, no open mode is implied. As a result, output-dest can be associated with any device-name in the SPECIAL-NAMES paragraph. For example, output-dest can refer to PAPER-TAPE-READER as well as PAPER-TAPE-PUNCH.

Format 2

  1. Format 2 is a Hewlett-Packard extension to the standard COBOL use of the DISPLAY statement.
  2. The Hewlett-Packard extensions to the ACCEPT and DISPLAY statements support data input and display only on the VT100 and later terminal types, including emulators of these terminal types.
  3. The UNDERLINED, BOLD, BLINKING, and REVERSED character attributes are not available on VT100 terminals without the advanced video option.
  4. You should display data only on fields that are within screen boundaries. That is, the terminal operator should see all the characters displayed. If data is displayed on fields that position the cursor outside screen boundaries, it does not result in an error condition. However, your program might not produce the results you expect.
    Values for screen boundaries depend on the terminal type and the column mode in which it is operating. Refer to the appropriate terminal user's guide for more information on screen boundaries.
  5. Line positioning can be a one- or two-step process. The first (or only) step is absolute positioning, which is using the value of line-num or line-id to determine the line position. The second step is relative positioning, which is adding the value of plus-num to line-id to determine the line position.
    The following sample statements would produce undefined results because they use absolute line positioning to reach a line beyond the bottom of the screen (assume ITEMB has a value of 25):


    Previous Next Contents Index