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 Manual426750-001
2-18
Conditional Expressions
Example 3
In the following example, with either of the following:
COMPUTE AX = A1/A2 + A3 * A4.
IF A1/A2 + A3 * A4 LESS THAN AX GO TO ...
the division is performed before further evaluation of either of the above statements.
The intermediate result is then adjusted to fit the conceptual PICTURE derived by
examining the other operands in the expression.
Incompatible Data
An incompatible data condition occurs when a data item is referenced by a statement in
the Procedure Division and that item contains characters not permitted by the statement.
For example, if a position in a display numeric item contains an alphabetic character, A,
and that item is used as an operand in an ADD statement, an incompatible data condition
occurs. The result of this reference is undefined.
The class condition test is an exception to this rule because its purpose is to determine
whether or not items contain legal data.
Conditional Expressions
Conditional expressions identify conditions that are tested by the program to select
between alternate paths of control. Conditional expressions are specified in the IF and
PERFORM statements.
The two categories of conditions for conditional expressions are: simple conditions and
complex conditions. Either kind of condition can be enclosed within any number of
paired parentheses without changing the category of the condition.
Simple Conditions
Simple conditions are of four kinds:
Class conditions
Condition-name conditions
Relation conditions
Sign conditions
Simple conditions have a truth value of true or false. Parentheses can enclose a simple
condition without changing the truth value of the condition.