COBOL Manual for TNS and TNS/R Programs

Procedure Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
8-61
Simple Conditions
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.
Usage Considerations:
Condition-Name Conditions
The rules for comparing a conditional variable with the literal values corresponding
to a condition-name are the same as those specified for relation conditions.
The result of the test is TRUE if either of these relations is satisfied:
°
The value of the conditional variable equals one of the single values
corresponding to the condition-name.
°
The value of the conditional variable falls within one of the ranges of values,
including the end values, corresponding to the condition-name.