[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP COBOL
Reference Manual


Previous Contents Index

See the rules for the INVALID KEY phrase, Section 6.6.10.

Technical Notes

  • In a Hewlett-Packard standard file-sharing environment for relative files, records that are manually locked and then deleted retain a lock on the deleted record. This affects a subsequent WRITE from a different access stream (either from a different file connector in the same run-unit or from a file connector in a different run-unit). A WRITE statement under such conditions gets a file status 92 (record locked by another program). All other statements will treat a record that was locked and subsequently deleted in the same manner as a record that was not locked and subsequently deleted.
  • DELETE statement execution can result in the following FILE STATUS data item values:

    File
    Status
    Access
    Method
    Meaning
    00 All Successful
    23 Rand, Dyn Record not in file (invalid key)
    43 Seq No previous READ or record not locked by prior READ or START
    49 All File not open, or incompatible open mode
    92 All Record locked by another program
    30 All All other permanent errors
  • If the current record to be deleted is not locked by the current stream, the delete results in a permanent error. On OpenVMS systems, RMS-STS indicates the record is not locked.

Additional References

6.8.10 DISPLAY

Function

The DISPLAY statement transfers low-volume data from the program to the default system output device or to the object of a mnemonic-name. The WITH CONVERSION phrase in Format 1 contains a Hewlett-Packard extension to the DISPLAY statement. The Hewlett-Packard extensions to Formats 2 and 3 are COBOL language additions that facilitate video forms design and data handling.

Format 4 sets a program variable to the current command line argument number (to read with a Format 7 ACCEPT), Format 5 sets the name of an environment variable or system logical, and Format 6 sets the value of an environment variable or system logical.


src-item

is a literal or the identifier of a data item. The literal can be any figurative constant.

arg-position

is a literal or identifier that specifies the desired argument position (on the run command line). It must be an unsigned integer.

argument-number

is a mnemonic name associated with ARGUMENT-NUMBER in the SPECIAL-NAMES paragraph in the Environment Division, representing the current argument position.

environment-name

is a mnemonic name associated with ENVIRONMENT-NAME in the SPECIAL-NAMES paragraph in the Environment Division, representing the name of an environment variable or system logical.

environment-value

is a mnemonic name associated with ENVIRONMENT-VALUE in the SPECIAL-NAMES paragraph in the Environment Division, representing the contents of the variable associated with the ENVIRONMENT-NAME.

envlog-name

references an alphanumeric data item, or is a nonnumeric literal.

envlog-value

references an alphanumeric data item, or is a nonnumeric literal.

output-dest

is a mnemonic-name defined in the SPECIAL-NAMES paragraph of the Environment Division.

line-num

is a numeric literal that specifies a line position on the terminal screen. line-num must be a positive integer. It cannot be zero.

line-id

is the identifier of a data item that provides a line position on the terminal screen. It must be a positive integer; it cannot be zero.

plus-num

is a numeric literal that increments the current value for line or column position, or that increments the value of line-id or column-id. plus-num can be zero or a positive integer.

column-num

is a numeric literal that specifies a column position on the terminal screen. column-num must be a positive integer. It cannot be zero.

column-id

is the identifier of a data item that provides a column position on the terminal screen. It must be a positive integer; it cannot be zero.

screen-name

is the name of a screen item defined in the SCREEN SECTION of the program.

stment

is an imperative statement executed if an exception condition exists; for Format 6, this means the name of the environment variable or logical has not been set by DISPLAY, or not enough space can be allocated to store the environment variable or logical.

stment2

is an imperative statement executed if the exception condition does not exist.

Syntax Rules

All Formats

  1. In a DISPLAY statement, the number of src-item entries cannot exceed 254.
  2. Each DISPLAY phrase can be specified only once for any src-item.

Formats 1 and 2

  1. The WITH NO ADVANCING phrase can be specified only once per DISPLAY statement. It must be specified last (or just preceding END-DISPLAY, if used) if multiple src-item entries or options are specified in the statement.

Format 1

  1. The UPON phrase can be specified only once per DISPLAY statement.

General Rules

Formats 1 and 2

  1. The UPON and WITH NO ADVANCING phrases apply to all instances of src-item.
  2. All phrases other than UPON and WITH NO ADVANCING apply to the immediately preceding src-item only.
  3. If there is a WITH NO ADVANCING phrase, the DISPLAY statement does not transfer any device positioning information after the last src-item value.

CONVERSION Phrase (Formats 1 and 2)

  1. The CONVERSION phrase allows you to display data in a field and achieve data conversion, sign, and decimal point placement. How the CONVERSION phrase affects data handling depends on the category of src-item. (Numeric data can be described by any USAGE clause.)
  2. Numeric items do not require the CONVERSION phrase to be displayed correctly with conversion if you specify /DISPLAY_FORMATTED (on OpenVMS Alpha and I64) or -display_formatted (on Tru64 UNIX) when you compile. (For more information on the qualifier, refer to the HP COBOL User Manual.)
  3. The CONVERSION phrase or the /DISPLAY_FORMATTED (OpenVMS Alpha and I64) qualifier displays nonnumeric items and numeric edited items without change.
  4. The CONVERSION phrase or the /DISPLAY_FORMATTED (OpenVMS Alpha and I64) qualifier displays non-floating-point numeric items according to the following rules:
    • The size of the displayed field is determined from the PICTURE character string.
    • Leading zeroes are displayed only when they immediately precede a decimal point.
    • If the sign is negative, a minus sign (-) is displayed. If the sign is positive, a space character is displayed. If the item is unsigned, no sign position is displayed.
    • Items with DISPLAY usage (for example, PIC 99, or PIC S99V99) are displayed after including a space, when needed, for a decimal point or sign or both.
      If you specify the SIGN TRAILING SEPARATE clause for the data item, the sign is displayed as a trailing sign. Otherwise, the sign is displayed as a leading sign.
    • Items other than DISPLAY (for example, PIC 99 COMP, or PIC S9V999 COMP SYNC) are displayed after conversion to DISPLAY usage SIGN LEADING.
    • Nonprinting numeric values are not human-readable on the terminal display unless the CONVERSION phrase or the /DISPLAY_FORMATTED qualifier (on OpenVMS Alpha and I64) or -display_formatted (on Tru64 UNIX) is specified.
  5. On OpenVMS, the CONVERSION phrase or /DISPLAY_FORMATTED (OpenVMS Alpha, I64), or -display_formatted (on Tru64 UNIX), displays floating-point items as follows:
    • The floating-point data item is converted from internal floating point to E-notation representation. (E-notation consists of a mantissa and, optionally, an exponent.)
      The E-notation is described as follows:
      Size of mantissa COMP-1 has 7 digits (F-floating, S-floating) plus decimal point and sign
      COMP-2 has 15 digits (G-floating, T-floating) or 16 digits (D-floating) plus decimal point and sign
      Sign of mantissa Sign shown only for negative, space if positive
      Form of mantissa d.dddddd for COMP-1
      d.dddddddddddddd for COMP-2 (G-floating, T-floating)
      d.ddddddddddddddd for COMP-2 (D-floating)
      "." replaced by "," if DECIMAL POINT IS COMMA
      Size of exponent 2 decimal digits for COMP-1 (F-floating, S-floating)
      2 decimal digits for COMP-2 (D-floating)
      3 decimal digits for COMP-2 (G-floating, T-floating)
      Range of exponent -38 to +38 (base 10) for COMP-1 (F-floating, S-floating)
      -38 to +38 (base 10) for COMP-2 (D-floating)
      -308 to +308 (base 10) for COMP-2 (G-floating, T-floating)
      Form of exponent E begins exponent sign shown for negative and positive; all digits shown (for example, E+01)
    • The size of the displayed field is 13 characters for COMP-1, and 22 characters for COMP-2. <>
  1. The CONVERSION phrase or the /DISPLAY_FORMATTED qualifier (on OpenVMS Alpha or I64) or -display_formatted (on Tru64 UNIX) displays floating-point items as follows:
    • The floating-point data item is converted from internal floating point to E-notation representation. (E-notation consists of a mantissa and, optionally, an exponent.)
    • The size of the displayed field is 13 characters for COMP-1 and 22 characters for COMP-2.
    • On Tru64 UNIX systems, the E-notation is described as follows:
      Size of mantissa COMP-1 has 7 digits (plus decimal point and sign).
      COMP-2 has 16 digits (plus decimal point and sign).
      Sign of mantissa Sign shown only for negative; space if positive.
      Form of mantissa d.dddddd for COMP-1.
      d.ddddddddddddddd for COMP-2.
      "." replaced by "," if DECIMAL POINT IS COMMA.
      Size of exponent 3 decimal digits for COMP-1 and COMP-2.
      Range of exponent -308 to +308 (base 10) for COMP-1 and COMP-2.
      Form of exponent E begins exponent sign shown for negative and positive; both digits shown (for example, E+01). <>

      On OpenVMS Alpha and I64 systems, compiled with the appropriate option on the /FLOAT qualifier, the E-notation is described as follows:
      Size of mantissa COMP-1 has 7 digits (F-floating, S-floating) plus decimal point and sign.
      COMP-2 has 15 digits (G-floating, T-floating) or 16 digits (D-floating) plus decimal point and sign.
      Sign of mantissa Sign shown only for negative; space if positive.
      Form of mantissa d.dddddd for COMP-1 (F-floating, S-floating)
      d.dddddddddddddd for COMP-2 (G-floating, T-floating.)
      d.ddddddddddddddd for COMP-2 (D-floating).
      "." replaced by "," if DECIMAL POINT IS COMMA.
      Size of exponent 2 decimal digits for COMP-1 (F-floating, S-floating).
      2 decimal digits for COMP-2 (D-floating).
      3 decimal digits for COMP-2 (G-floating, T-floating).
      Range of exponent -38 to +38 (base 10) for COMP-1 (F-floating, S-floating).
      -38 to +38 (base 10) for COMP-2 (D-floating).
      -308 to +308 (base 10) for COMP-2 (G-floating, T-floating).
      Form of exponent E begins exponent sign shown for negative and positive; all digits shown (for example, E+01). <>


Previous Next Contents Index