COBOL Manual for TNS/E Programs (H06.03+)

Procedure Division
HP COBOL Manual for TNS/E Programs520347-003
8-61
Simple Conditions
ALPHABETIC-LOWER and NOT ALPHABETIC-LOWER
You cannot use the ALPHABETIC-LOWER and NOT ALPHABETIC-LOWER tests
with a numeric data item. The tested item belongs to the alphabetic-lower class
only if its content consists entirely of the lowercase alphabetic characters a
through z and space. When the CHARACTER-SET clause specifies a program
character set other than USASCII or UK, the set of characters that constitute the
alphabetic class is extended as appropriate (see OBJECT-COMPUTER
Paragraph).
ALPHABETIC-UPPER and NOT ALPHABETIC-UPPER
You cannot use the ALPHABETIC-UPPER and NOT ALPHABETIC-UPPER tests
with a numeric data item. The tested item belongs to the alphabetic-upper class
only if its content consists entirely of the uppercase alphabetic characters A
through Z and space. When the CHARACTER-SET clause specifies a program
character set other than USASCII or UK, the set of characters that constitute the
alphabetic class is extended as appropriate (see OBJECT-COMPUTER
Paragraph).
Class-name and NOT Class-name
You cannot use the class-name and NOT class-name tests with a numeric data
item. The result of the test is TRUE if the content of the data item consists entirely
of the characters listed in the definition of the class-name in the SPECIAL-NAMES
paragraph; otherwise the result is FALSE.
Class conditions are useful for field validation:
PART-NUMBER IS NUMERIC
REPLY-FIELD IS NOT ALPHABETIC
DIAGNOSTIC-MESSAGE IS NOT ALPHABETIC-UPPER
If the SPECIAL-NAMES paragraph includes the description
CLASS VOWEL IS "A" "E" "I" "O" "U" "a" "e" "i" "o" "u".
the procedure division can use this condition for validation:
SOME-FIELD IS VOWEL
Condition-Name Conditions (Conditional Variables)
In a condition-name condition, a conditional variable is tested to determine whether or
not its value is equal to one of the values or within one of the ranges of values
associated with a condition-name.