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

Example 91 EVALUATE Statement as a Decision Table
EVALUATE XXX ALSO "GONE" ALSO ( A + B ) / C ALSO X = Y
WHEN 5 ALSO ANY ALSO 25 ALSO TRUE
PERFORM PROC-A
WHEN 10 THRU 30 ALSO YYY ALSO 2 ALSO FALSE
PERFORM PROC-B
WHEN OTHER ADD 1 TO VACUOUS-COUNT
END-EVALUATE
Subject-Object Correspondence
Every object-list must have an object for every subject in the subject-list. Each
object in an object-list must correspond to the subject that has the same ordinal
position in the subject-list. The rules that determine whether a subject and object
correspond are:
The object value ANY corresponds to any subject value.
An object that is a condition or the value TRUE or FALSE corresponds to a subject
that is a conditional expression or the value TRUE or FALSE.
An object composed of identifiers, literals, or arithmetic expressions corresponds to a
subject if the value of the object is a valid operand for comparison to the subject.
Subject-Object Comparisons
EVALUATE operates as if each corresponding subject and object were evaluated and
assigned one of:
A numeric or nonnumeric value
A range of numeric or nonnumeric values
TRUE
FALSE
The subject is determined:
EVALUATE uses subject
The value and class of the data item referenced by identifieridentifier
The value and class of literalliteral
The numeric value determined by the rules for evaluating
arithmetic expressions
arithmetic expression
The truth value determined by the rules for evaluating conditional
expressions
conditional expression
TRUETRUE
FALSEFALSE
The object is determined:
EVALUATE uses object
The value and class of the data item referenced by identifieridentifier (without NOT or THRU)
The value and class of literalliteral (without NOT or THRU)
EVALUATE 327