In this topic, we described about the MULTIPLY Statement with detailed example.
The MULTIPLY statement multiplies numeric items and sets the result values. Floating-point data items and literals can be used where a numeric data item or literal used.
Syntax-1: MULTIPLY statement
In the above syntax, the value of identifier-1 or literal-1 is multiplied by the value of identifier-2. The multiplied result is stored in identifier-2.
Multiple data items can place instead of identifier-2, the multiplication takes place in the left-to-right order in which identifier-2 is specified.
Syntax-2: MULTIPLY statement with GIVING phrase
In the above syntax, the value of identifier-1 or literal-1 is multiplied by the value of identifier-2 or literal-2. The multiplied result is stored in the data items referenced by identifier-3.
identifier-1, identifier-2 -
Must name an elementary numeric item. identifier-1 and identifier-2 cannot be date fields.
literal-1, literal-2 -
Must be a numeric literal.
Must name an elementary numeric or numeric-edited item. identifier-3 is the only identifier in the MULTIPLY statement that can be a date field.
END-MULTIPLY phrase -
The END-MULTIPLY used to end the scope of the MULTIPLY statement. END-MULTIPLY is not required when MULTIPLY statement ended with period.