COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-137
MULTIPLY GIVING
imperative-stmt-1
is an imperative statement to be executed when a size error is detected in the
multiplication or in storing the product in result.
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 result.
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 GIVING C D E
means store A x B into C, D, and E. The values of A and B do not change.
•
Operand Identification
For each result, operand identification occurs just prior to the storage operation.
For example, in the statement
MULTIPLY A BY B GIVING C D(C)
the subscript is not evaluated until C has been set to A x B. 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.
•
Edited Result
The MULTIPLY GIVING statement can produce an edited result, as Example 9-47
shows.