[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP COBOL
Reference Manual


Previous Contents Index

COLUMN NUMBER Phrase (Formats 3 and 4)

  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 accepted from 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 input 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 5) (Alpha, I64)

  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 (Formats 3 and 4)

  1. The ERASE phrase erases all, or part, of a line (or screen) before accepting data. You must specify SCREEN or LINE with the ERASE phrase.
  2. If you use the 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 the TO END option, the ERASE phrase erases the entire line (or screen).

BELL Phrase (Formats 3 and 4)

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

CONTROL KEY Phrase (Formats 3 and 4)

  1. If you use the CONTROL KEY phrase, the characters representing PF keys and arrow keys, as well as TAB and RETURN, are legal terminator keys and can be accepted from the terminal. (See Technical Notes.)
  2. key-dest-item stores the terminator key code; unused character positions, if any, are filled with spaces. (See Technical Notes.)

ON EXCEPTION Phrase (Formats 3 and 4)

  1. The ON EXCEPTION phrase allows execution of an imperative statement when an exception (or error) condition occurs. ON EXCEPTION takes effect when illegal numeric data has been entered or there is an overflow on the left or right of the decimal point when CONVERSION is specified.
  2. ON EXCEPTION can be used to detect numeric data entry errors only when accepting numeric data while CONVERSION is being used.
  3. ON EXCEPTION can be used to detect end-of-file in any Format 3 or Format 4 ACCEPT statement.
  4. ON EXCEPTION and AT END are mutually exclusive. If ON EXCEPTION is specified, the end-of-file indication is also a control key.
  5. A DISPLAY statement within an ACCEPT ON EXCEPTION must be terminated (with, for example, END-DISPLAY) on Alpha and I64 systems. (If you are concerned with the different VAX behavior, refer to the appendix on compatibility in the HP COBOL User Manual.)

NOT ON EXCEPTION Phrase (Formats 3 and 4)

  1. The NOT ON EXCEPTION phrase allows execution of an imperative statement when an exception (or error) condition does not occur.

ON EXCEPTION Phrase (Format 5, Alpha, I64)

  1. The ON EXCEPTION phrase allows execution of an imperative statement when the ACCEPT statement terminates unsuccessfully. When there is an applicable CRT STATUS clause, unsuccessful termination is indicated by a value of '1' or '9' in the first character of the CRT STATUS data item (see the SPECIAL-NAMES section of Chapter 4).

NOT ON EXCEPTION Phrase (Format 5, Alpha, I64)

  1. The NOT ON EXCEPTION phrase allows execution of an imperative statement when the ACCEPT statement terminates successfully. When there is an applicable CRT STATUS clause, successful termination is indicated by a value of '0' in the first character of the CRT STATUS data item (see the SPECIAL-NAMES section of Chapter 4). <>

NOT ON EXCEPTION Phrase (Formats 3 and 4; and Formats 5, 7, and 8, Alpha, I64)

  1. A DISPLAY statement within an ACCEPT [NOT] ON EXCEPTION statement must be terminated (with, for example, END-DISPLAY).

AT END Phrase (Formats 3 and 4)

  1. The AT END phrase allows execution of an imperative statement when an end-of-file condition occurs.
  2. AT END and ON EXCEPTION are mutually exclusive.
  3. If AT END is specified, the end-of-file indication is also a control key. If you do not specify AT END or ON EXCEPTION, and end-of-file is entered, an error condition occurs.

NOT AT END Phrase (Formats 3 and 4)

  1. The NOT AT END phrase allows execution of an imperative statement when an end-of-file condition (or other error) does not occur.

Format 3

UNDERLINED Phrase (Format 3)

  1. The UNDERLINED phrase echoes input characters to the terminal with the underscore on character attribute.
  2. When you use the UNDERLINED phrase with the PROTECTED phrase, the input field is underlined prior to accepting data.

BOLD Phrase (Format 3)

  1. The BOLD phrase echoes input characters to the terminal with the bold on character attribute.
  2. When you use the BOLD phrase with the PROTECTED phrase, the input field is visibly bolded prior to accepting data only if: (1) the underlined or reversed attributes are also specified, or (2) the video terminal screen is set to light background.

BLINKING Phrase (Format 3)

  1. The BLINKING phrase echoes input characters to the terminal with the blink on character attribute.
  2. When you use the BLINKING phrase with the PROTECTED phrase, the input field is visibly blinked prior to accepting data only if: (1) the underlined or reversed attributes are also specified, or (2) the video terminal screen is set to light background.

REVERSED Phrase (Format 3)

  1. The REVERSED phrase echoes input characters to the terminal with the reverse video on character attribute.
  2. When you use the REVERSED phrase with the PROTECTED phrase, the input field appears in reverse video prior to accepting data.

CONVERSION Phrase (Formats 1 and 3)

  1. The CONVERSION phrase allows you to accept data into a field and achieve the same results as you would with the MOVE statement for non-floating-point items, and provides conversion from display, display scaled or E-notation to floating point in the case of floating-point data items. It enables validation of the accepted data and facilitates editing and alignment of data within dest-item. The effect of the CONVERSION phrase on data handling depends on the category of dest-item. (Numeric data can be described by any USAGE clause.)
  2. When dest-item is numeric or numeric edited (other than floating point), the CONVERSION phrase:
    • Converts input numeric data to a numeric literal (TRAILING SEPARATE SIGNED DISPLAY DECIMAL)
    • Moves the result to dest-item (using MOVE statement rules)
  3. When dest-item is floating point, the CONVERSION phrase:
    • Converts input data to floating point (COMP-1 or COMP-2 as appropriate).
    • Moves the converted result to the destination as if a numeric literal equivalent to the input data was moved to the destination with the MOVE statement.
  4. When dest-item is numeric or numeric edited (other than floating point), and you use the CONVERSION phrase, valid input characters are as follows:
    • 0 to 9
    • Period (.), unless DECIMAL POINT IS COMMA is specified
    • Comma (,), if DECIMAL POINT IS COMMA is specified
    • Space (leading and trailing)
    • Sign (+ or -)

    The terminal operator can input space characters only as leading and trailing spaces. If this occurs, space characters are simply ignored during numeric conversion.
    However, the operator cannot input space characters between numeric characters, between numeric characters and a decimal point, or between a sign and any other input character. When this occurs, the input data is invalid, and an error condition results.
    The operator can input only one sign character and one decimal point character.
    When the operator inputs a sign character, it must precede or follow all numeric characters and the decimal point.
    The default sign character is a plus sign (+).
    The default number of decimal places is zero.
  5. When dest-item is floating point, and you use the CONVERSION phrase, valid input characters are as follows:
    • <zero or more blanks>
    • <"+", "-", or null>
    • <zero or more decimal digits>
    • <"." or null> if DECIMAL POINT IS COMMA then <"," or null>
    • <zero or more decimal digits>
    • <exponent or null> where exponent is:
      <"E" or "e">
      <zero or more blanks>
      <"+" or "-" or null>
      or
      <"+" or "-">>
      <zero or more decimal digits>>

For example:


2.5E2
-0.08e4
10.0E-1
-2.14158E0

Note that numbers can be expressed in several ways. For example, the number 257.0 can be represented in any of the following ways:


Previous Next Contents Index