Multiple Results

When an arithmetic statement has multiple results, execution conceptually proceeds as follows:
For example, executing the following statement:
ADD A, B, C, TO C, D(C), E.
is equivalent to executing the following series of statements:
ADD A, B, C GIVING TEMP.
ADD TEMP TO C.
ADD TEMP TO D(C).
ADD TEMP TO E.
In the above example, TEMP is a compiler-supplied temporary result field. When the addition operation for D(C) is performed, the subscript C contains the new value of C.
Note: Intermediate results generated during the execution of arithmetic statements are system-specific and can affect program portability. Use of the individual arithmetic statements ADD, SUBTRACT, MULTIPLY, and DIVIDE, rather than COMPUTE, reduces the risk of getting inconsistent results.