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 | ALPHABETIC | ALPHABETIC-LOWER | ALPHABETIC-UPPER | class-name}
Syntax rules
identifier must be a data item described implicitly or explicitly with USAGE DISPLAY or USAGE NATIONAL or COMPUTATIONAL-3 or PACKED-DECIMAL.
Table 19 lists all categories of identifiers which are permissible in the tests:
Tests Permissible for identifiers of the categories NOT] ALPHABETIC
[NOT] ALPHABETIC-LOWER
[NOT] ALPHABETIC-UPPERAlphabetic
Alphanumeric
Alphanumeric-edited
Numeric-edited
National[NOT] NUMERIC Alphanumeric
Alphanumeric-edited
Numeric-edited
Numeric
Nationalclass-name Alphabetic
Alphanumeric
Alphanumeric-edited
Numeric-edited
Numeric (only USAGE DISPLAY)Table 19: Valid formats of the class condition
General rules
identifier specifies the data item to be tested.
NUMERIC, ALPHABETIC, ALPHABETIC-LOWER, ALPHABETIC-UPPER and class-name (possibly negated by NOT) indicate which characteristic is to be tested.
If identifier is a zero-length item, the value of the class condition without a NOT phrase is "false".
identifier is treated as numeric when
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".its category is not numeric and it contains only the digits 0 through 9.
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.
identifier is treated as alphabetic-lower when its contents consist of a combination of the lowercase letters a through z and the space character.
identifier is treated as alphabetic-upper when its contents consist of a combination of the uppercase letters A through Z and the space character.
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.