COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-134
MULTIPLY BY
imperative-stmt-2
is an imperative statement to be executed when no size error is detected in the
multiplication or in storing the product in multiplier.
END-MULTIPLY
ends the scope of the MULTIPLY statement and makes it a delimited-scope
statement. If you omit END-MULTIPLY but include the SIZE ERROR or NOT SIZE
ERROR phrase, the MULTIPLY statement is a conditional statement and ends at
the next period separator.
Usage Considerations:
•
Mathematics
The statement
MULTIPLY A BY B C D
means store A x B into B, A x C into C, and A x D into D.
•
Repeating a Multiplier
If more than one multiplier specifies the same data item, the
final value of that data item reflects more than one
multiplication by multiplicand. For example,
MULTIPLY 4 BY A B B
results in A being replaced by 4 x A and B being replaced by 16 x B.
•
Operand Identification
For each multiplier, operand identification occurs just prior to the multiply-and
store operation. For example, in the statement
MULTIPLY 4 BY A B C(B)
the subscript is not evaluated until B has been multiplied by 4. See Operand
Identification.
•
Arithmetic Operations
See Arithmetic Operations for information on data conversion and alignment,
intermediate results, multiple results (and subscript evaluation), and incompatible
data.
•
Precision
If you omit the SIZE ERROR phrase, arithmetic overflow can cause the run unit to
terminate abnormally. For information on precision of multiplication, see Arithmetic
Precision.
•
ROUNDED and SIZE ERROR Phrases
See ROUNDED Phrase and SIZE ERROR Phrase for information on these.