COBOL Manual for TNS and TNS/R Programs

Procedure Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
8-64
Complex Conditions
Complex Conditions
A complex condition is a combination of simple conditions and any of the logical
operators NOT, AND and OR. Its truth value is the one that results from the interaction
of the stated logical operators on the individual truth values of the simple conditions or
conditions enclosed within parentheses.
A complex condition formed by applying the unary operator NOT to a simple or
parenthetical condition is called a negated condition. A complex condition formed by
applying the binary operator AND or OR to two conditions (either of which can be
simple or parenthetical) is called a combined condition.
Negated Conditions
simple-condition
is described in Simple 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.
Table 8-17. Logical Operators
Operator
MeaningSymbol Kind
NOT Unary Logical negation (reversal of truth value): The truth value is TRUE if the
condition is FALSE, FALSE if the condition is TRUE
AND Binary Logical conjunction: The truth value is TRUE if both conjoined
conditions are TRUE, FALSE if one or both conjoined conditions are
FALSE
OR Binary Logical inclusive OR: The truth value is TRUE if one or both included
conditions are TRUE, FALSE if both included conditions are FALSE
NOT
simple-condition
condition
( )
VST122.vsd