Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

MULTIPLY statement

Function

The MULTIPLY statement is used to perform multiplication of two numeric operands and store the result.

Format 1

of the MULTIPLY statement stores the products in the specified multiplier.

Format 2

of the MULTIPLY statement uses the GIVING phrase.

Format 1


MULTIPLY {identifier-1 | literal-1} BY {identifier-2 [ROUNDED]}...

[ON SIZE ERROR imperative-statement-1]

[NOT ON SIZE ERROR imperative-statement-2]

[END-MULTIPLY]


Syntax rules

  1. Each identifier must refer to a numeric elementary item.

  2. The value of identifier-1 or literal-1 is multiplied by the value of identifier-2. The multiplication product replaces the current value of identifier-2.

  3. The maximum size of the product is 31 decimal digits.

Additional rules are given under "Phrases in statements" et seq., where the ROUNDED, (NOT) ON SIZE ERROR, and GIVING phrases are discussed.

Example 8-57

Statement

PICTURE of result item

Calculation

MULTIPLY A BY B

999

A * B stored in B as nnn

Format 2


MULTIPLY {identifier-1 | literal-1} BY {identifier-2 | literal-2}

GIVING {identifier-3 [ROUNDED]}...
[ON SIZE ERROR imperative-statement-1]
[NOT ON SIZE ERROR imperative-statement-2]
[END-MULTIPLY]


Syntax rules

  1. Each identifier preceding the word GIVING must refer to a numeric elementary item.

  2. identifier-3... may refer to a numeric elementary item or a numeric edited elementary item.

  3. The value of identifier-1 or literal-1 is multiplied by the value of identifier-2 or literal-2, and the product is stored in identifier-3 (the same applies to additional receiving items).

  4. The maximum size of the product is 31 decimal digits.

Additional rules are given under "Phrases in statements" et seq., where the ROUNDED, (NOT) ON SIZE ERROR, and GIVING phrases are discussed.

Example 8-58

Statement

PICTURE of result item (C)

Calculation

MULTIPLY A BY B GIVING C

9(5)

A * B stored in C as nnnnn