COBOL Manual for TNS/E Programs (H06.03+)
Procedure Division
HP COBOL Manual for TNS/E Programs—520347-003
8-45
Arithmetic Expressions
TEMP is the intermediate data item. Any subscripts specified in a reference to a
receiving item are evaluated just prior to the assignment operation for that item.
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.
+
-
num-id
+
-
**
num-lit
arith-expr
(
)arith-expr
*
/
arith-expr
VST739.vsd










