COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Example 70 Sign Conditions
( A - 10 ) IS POSITIVE
B NOT ZERO
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.
Table 54 Logical Operators
Operator
MeaningKindSymbol
Logical negation (reversal of truth value): The truth value is TRUE if the condition
is FALSE, FALSE if the condition is TRUE
UnaryNOT
Logical conjunction: The truth value is TRUE if both conjoined conditions are
TRUE, FALSE if one or both conjoined conditions are FALSE
BinaryAND
Logical inclusive OR: The truth value is TRUE if one or both included conditions
are TRUE, FALSE if both included conditions are FALSE
BinaryOR
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.
Combined Conditions
condition
is a simple or complex condition.
Conditional Expressions 273










