For the best performance from arithmetic statements:
MOVE a TO b ADD a TO b SUBTRACT a FROM b MULTIPLY a BY b DIVIDE a INTO b IF a condition b
where:
a Is a numeric literal value or data item up to four bytes long
b Is a numeric data item up to four bytes long
On other data items, these simple operations result in faster code than more complex instructions, but the benefits are not as great as with COMP-5 or COMP-X items. More complex forms of these instructions, involving more than two operands, might not produce code which is as efficient as the simple form.
MOVE a TO c ADD b TO c
rather than:
ADD a TO b GIVING c
Provided that the operands are all of the same type, statements that contain the GIVING phrase are optimized.
Related Topics: