Arithmetic expressions can appear in contexts other than arithmetic statements. For example, you can use an arithmetic expression with the IF or EVALUATE statement.
In such statements, the rules for intermediate results with fixed-point data and for intermediate results with floating-point data apply, with the following changes:
For example:
IF operand-1 = expression-1 THEN . . .
If operand-1 is a data-name defined to be COMP-2, the rules for floating-point arithmetic apply to expression-1 even if it contains only fixed-point operands, because it is being compared to a floating-point operand.
EVALUATE expression-1 WHEN expression-2 THRU expression-3 WHEN expression-4 . . . END-EVALUATE
In the statement above, each arithmetic expression is evaluated in fixed-point or floating-point arithmetic based on its own characteristics.
related concepts
Fixed-point contrasted with floating-point arithmetic
related references
Terminology used for intermediate results
Fixed-point data and intermediate results
Floating-point data and intermediate results
IF statement
(COBOL for Windows Language Reference)
EVALUATE statement
(COBOL for Windows Language Reference)
Conditional expressions
(COBOL for Windows Language Reference)