Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
SCREEN COBOL Source Program
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
2-23
Condition Evaluation Rules
to the next relation. The following examples illustrate abbreviated combined relation
conditions and their expanded equivalents.
Condition Evaluation Rules
Parentheses are used to change the order in which individual conditions are evaluated
when it is necessary to depart from the standard order. Conditions within parentheses
are evaluated first. When conditions are within nested parentheses, evaluation goes
from the innermost condition to the outermost condition.
When parentheses are not used or when conditions in parentheses are at the same level,
the following order of evaluation is used until the final truth value is determined:
1. Values are established for arithmetic expressions.
2. Truth values for simple conditions are established in the following order:
a. Relation conditions
b. Class conditions
c. Condition-name conditions
d. Sign conditions
3. Truth values for negated simple conditions are established.
4. Truth values for combined conditions are established: AND logical operators,
followed by OR logical operators.
5. Truth values for negated combined conditions are established.
6. When the sequence of evaluation is not completely specified by parentheses, the
order of evaluation of consecutive operations of the same hierarchical level is from
left to right.
Abbreviated Combined Relation
Condition Expanded Equivalent
a > b AND NOT < c OR d ((a > b) AND (a NOT < c))
OR (a NOT < d)
a NOT EQUAL b OR c (a NOT EQUAL b) OR (a NOT EQUAL c)
NOT a = b OR c (NOT (a = b)) OR (a = c)
NOT (a GREATER b OR < c) NOT ((a GREATER b) OR (a < c))
NOT (a NOT > b AND c
AND NOT d)
NOT ((((a NOT > b)
AND (a NOT > c))
AND (NOT (a NOT > d))))
(a + b - c) > d
AND NOT < e OR f
(a + b - c) > d
AND (a + b - c) NOT < e
OR (a + b - c) NOT < f