


The COMPUTE statement provides the ability to perform general arithmetic computations.
General Format
COMPUTE { result [ROUNDED] } ... = arithmetic-expression
[ ON SIZE ERROR statement ]
[ NOT ON SIZE ERROR statement ]
[ END-COMPUTE ]
Syntax Rules
1. Result is an elementary numeric or numeric-edited data item.
2. Arithmetic-expression is any arithmetic expression.
3. Statement is an imperative statement.
General Rules
1. The arithmetic-expression is evaluated and assigned to each result variable.
2. Additional information can be found in the sections covering Arithmetic Operations (6.4.1), Multiple Receiving Fields (6.4.2), the ROUNDED option (6.4.3), and the SIZE ERROR option (6.4.4).