Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Class condition

Function

The class condition determines whether an operand is numeric, alphabetic, alphabeticlower, alphabetic-upper, or whether it contains only characters from a character set specified with class-name in the CLASS clause of the SPECIAL-NAMES paragraph of the Environment Division.

Format


identifier IS [NOT] {NUMERIC | ALPHABETICALPHABETIC-LOWERALPHABETIC-UPPER | class-name}


Syntax rules

  1. identifier must be a data item described implicitly or explicitly with USAGE DISPLAY or USAGE NATIONAL or COMPUTATIONAL-3 or PACKED-DECIMAL.

  2. Table 19 lists all categories of identifiers which are permissible in the tests:

    TestsPermissible for identifiers of the categories
    NOT] ALPHABETIC
    [NOT] ALPHABETIC-LOWER
    [NOT] ALPHABETIC-UPPER
    Alphabetic
    Alphanumeric
    Alphanumeric-edited
    Numeric-edited
    National
    [NOT] NUMERICAlphanumeric
    Alphanumeric-edited
    Numeric-edited
    Numeric
    National
    class-nameAlphabetic
    Alphanumeric
    Alphanumeric-edited
    Numeric-edited
    Numeric (only USAGE DISPLAY)

    Table 19: Valid formats of the class condition

General rules

  1. identifier specifies the data item to be tested.

  2. NUMERIC, ALPHABETIC, ALPHABETIC-LOWER, ALPHABETIC-UPPER and class-name (possibly negated by NOT) indicate which characteristic is to be tested.

  3. If identifier is a zero-length item, the value of the class condition without a NOT phrase is "false".

  4. identifier is treated as numeric when

    1. its numeric category is

      • identifier is described with USAGE DISPLAY and it contains only the sign corresponding to its description and the digits 0 through 9.

      • identifier is described with USAGE COMP-3 or USAGE PACKED-DECIMAL and its content is numeric.

      If no sign is defined in the PICTURE character-string, only F is permitted as a sign in the internal representation.
      If a sign is defined, you will find detailed information in section "SIGN clause".

    2. its category is not numeric and it contains only the digits 0 through 9.

  5. identifier is treated as alphabetic when its contents consist of any combination of the characters A through Z and/or a through z and the space character.

  6. identifier is treated as alphabetic-lower when its contents consist of a combination of the lowercase letters a through z and the space character.

  7. identifier is treated as alphabetic-upper when its contents consist of a combination of the uppercase letters A through Z and the space character.

  8. identifier corresponds to class-name when its contents consist solely of a combination of those characters which were defined by means of class-name in the SPECIAL-NAMES paragraph.