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

Procedure Division
HP COBOL Manual for TNS/E Programs520347-003
8-65
Complex Conditions
condition
is a simple or complex condition.
The truth value of a negated condition is the opposite of the truth value of the operand
condition.
You do not need to use parentheses when you use either AND or OR exclusively in a
combined condition. When you use a mixture of AND, OR, and NOT, you can use
parentheses to effect a final truth value.
Combined Conditions
condition
is a simple or complex condition.
As Table 8-18 shows, you can use the element pair OR NOT, but you cannot use the
pair NOT OR. Also, you can use NOT, but you cannot use NOT NOT. Within the
combined condition, parentheses must always be in balanced pairs, so that each left
parenthesis precedes its corresponding right parenthesis.
Table 8-18. Conditions, Logical Operators, and Parentheses
Element
Location in
Conditional
Expression In a left-to-right sequence of elements
First Last
When not first, element
can be immediately
preceded only by
When not last, element can
be immediately followed only
by
simple-
condition
Yes Yes AND, NOT, OR, ( AND, OR, )
AND or OR No No simple-condition, ) NOT, (, simple-condition
NOT Yes No AND, OR, ( (, simple-condition
( Yes No AND, NOT, OR, ( NOT, (, simple-condition
)NoYessimple-condition, ) AND, OR, )
condition
AND
OR
condition
VST123.vsd