Previous Topic: DIVIDENext Topic: SUBTRACT


MULTIPLY

Purpose

Calculates the product of two variables.

Syntax

►►─── MULTIPLY arithmetic-expression by variable ── options ── . ─────────────►◄

Expansion of options

►───┬─────────────────────────────────┬──────────────────────────────────────►◄
    ├─ ROUNDED ───────────────────────┤
    ├─ TRUNCATED ─────────────────────┤
    └─ ALLOWING assignment-condition ─┘

Parameters

arithmetic-expression

Specifies the arithmetic expression being added to the value contained in variable.

by variable

Specifies the data field that contains the value by which arithmetic-expression is multiplied. Following execution of the command, variable contains the result of the MULTIPLY operation.

ROUNDED

Rounds the result of the multiplication to the number of decimal positions found in variable.

TRUNCATED

Truncates the result of the multiplication to the number of decimal positions found in variable.

The default specification is ROUNDED if COBOL moves are enabled is not selected and TRUNCATED if the option is selected,

ALLOWING

Specifies which error conditions would normally abend and should cause control to be returned to the dialog for error handling. The list of allowable assignment-condition names can be found in the section entitled "Arithmetic and Assignment Command Status Condition."

Usage

Definition

The MULTIPLY command is used to perform multiplication. A variable data field value, a numeric literal, or the result of an arithmetic expression is multiplied by a variable data field value. The result is placed in the variable data field that contains the right operand.

Example

The following example illustrates the use of the MULTIPLY command to multiply the value in the FICA-PCT field by the value in the second occurrence of the DEDUCT field:

MULTIPLY FICA-PCT BY DEDUCT(2).

More information:

Assignment Command

Arithmetic Expressions