The MULTIPLY statement multiplies numeric items and stores the result.
The MULTIPLY statement has two formats:
MULTIPLY Statement - Format 1
>>-MULTIPLY--+-identifier-1-+--BY------------------------------->
'-literal-1----'
.---------------------------.
V |
>----identifier-2--+---------+-+-------------------------------->
'-ROUNDED-'
>--+--------------------------------------------+--------------->
'-+----+--SIZE ERROR--imperative-statement-1-'
'-ON-'
>--+-------------------------------------------------+---------->
'-NOT--+----+--SIZE ERROR--imperative-statement-2-'
'-ON-'
>--+--------------+--------------------------------------------><
'-END-MULTIPLY-'
In Format 1, the value of identifier-1 or literal-1 is saved. This value is multiplied by and stored in each identifier-2, in the left-to-right order in which identifier-2 is specified.
MULTIPLY Statement - Format 2 - GIVING
>>-MULTIPLY--+-identifier-1-+--BY--+-identifier-2-+------------->
'-literal-1----' '-literal-2----'
.---------------------------.
V |
>--GIVING----identifier-3--+---------+-+------------------------>
'-ROUNDED-'
>--+--------------------------------------------+--------------->
'-+----+--SIZE ERROR--imperative-statement-1-'
'-ON-'
>--+-------------------------------------------------+---------->
'-NOT--+----+--SIZE ERROR--imperative-statement-2-'
'-ON-'
>--+--------------+--------------------------------------------><
'-END-MULTIPLY-'
In Format 2, the value of identifier-1 or literal-1 is multiplied by the value of identifier-2 or literal-2. The product is then stored in each data item referenced by identifier-3.
For all Formats:
The composite of operands is determined by superimposing all of the receiving data items. For more information on the composite of operands, see the Size of Operands.
+-------------------------------IBM Extension--------------------------------+
Floating-point data items and literals can be used anywhere a numeric data item or literal can be specified.
+----------------------------End of IBM Extension----------------------------+
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.