COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Incompatible Data
Normally, whenever the contents of a data item are used in the Procedure Division and the current
contents of that data item are not compatible with the class and size specified by its PICTURE
clause, the result of the reference is undefined; that is, the semantic rules of the COBOL language
apply only when operands have values corresponding to their descriptions. The single exception
to this rule is the class condition, which exists specifically to permit testing whether or not an
operand’s value corresponds to its description. The presence of incompatible data can cause
execution of the run unit to terminate abnormally.
Some computations can generate a negative zero (for example, when the value of an expression
is -0.05, and this value is stored in a variable that is described as PICTURE S99V9). When the
program uses the value negative zero, it ignores the sign.
Arithmetic Expressions
num-id
is the identifier of a numeric data item.
num-lit
is a numeric literal.
arith-expr
is an arithmetic expression.
The value of an arithmetic expression is a numeric value.
Arithmetic expressions can appear in:
• ENTER statements
• EVALUATE statements
• Reference modifiers
• Sign conditions
• Relation conditions
• Function arguments
The values computed when arithmetic expressions are evaluated are transitory and are not stored
for later use by the program.
Topics:
• Operands
• Arithmetic Operators
• Formation and Evaluation Rules
Arithmetic Operations 259










