The class condition determines whether the content of a data item is alphabetic, alphabetic-lower, alphabetic-upper, numeric, or contains only the characters in the set of characters specified by the CLASS clause as defined in the SPECIAL-NAMES paragraph of the Environment Division.
Class Condition - Format >>-identifier--+----+--+-----+--+-NUMERIC----------+----------->< '-IS-' '-NOT-' +-ALPHABETIC-------+ +-ALPHABETIC-LOWER-+ +-ALPHABETIC-UPPER-+ | (1) | +-DBCS-------------+ | (1) | +-KANJI------------+ '-class-name-------'
If identifier is a function identifier, it must reference an alphanumeric, DBCS, or date-time function.
If its PICTURE does not contain an operational sign, the item being tested is determined to be numeric only if the contents are numeric and an operational sign is not present.
If its PICTURE does contain an operational sign, the item being tested is determined to be numeric only if the item is an elementary item, the contents are numeric, and a valid operational sign is present.
In the EBCDIC character set, valid embedded operational positive signs are hexadecimal F, C, E, and A. Negative signs are hexadecimal D and B. The preferred positive sign is hexadecimal F, and the preferred negative sign is hexadecimal D. For items described with the SIGN IS SEPARATE clause, valid operational signs are + (hex 4E) and - (hex 60).
For numeric and date-time data items, the identifier being tested can be described implicitly or explicitly as USAGE DISPLAY, USAGE PACKED-DECIMAL, USAGE COMP, or USAGE COMP-3.
The class-name test must not be used with an identifier described as numeric.
The class test is not valid for items whose usage is INDEX, POINTER, or PROCEDURE-POINTER because these items do not belong to any class or category.
The class condition cannot be used for external floating-point (USAGE DISPLAY) or internal floating-point (USAGE COMP-1 and USAGE COMP-2) items.
Table 21 shows valid forms of the class test.
| Type of Identifier | Valid Forms of the Class Test | |
|---|---|---|
|
Alphabetic |
ALPHABETIC ALPHABETIC-LOWER ALPHABETIC-UPPER class-name |
NOT ALPHABETIC NOT ALPHABETIC-LOWER NOT ALPHABETIC-UPPER NOT class-name |
|
Alphanumeric, Alphanumeric-edited, or Numeric-edited |
ALPHABETIC ALPHABETIC-LOWER ALPHABETIC-UPPER NUMERIC class-name |
NOT ALPHABETIC NOT ALPHABETIC-LOWER NOT ALPHABETIC-UPPER NOT NUMERIC NOT class-name |
|
External-Decimal Internal-Decimal |
NUMERIC |
NOT NUMERIC |
|
IBM® Extension
DBCS
DBCS-edited End of IBM® Extension |
DBCS KANJI |
NOT DBCS NOT KANJI |
|
IBM® Extension
Date-Time
End of IBM® Extension |
NUMERIC class-name |
NOT NUMERIC NOT class-name |