MUL examples

Last Updated : Sep 08, 2012 |

The following table provides examples for using the MUL operator. The MUL operator multiplies operand1 by operand2.

Command

Result

set A = A MUL 10

A = 000123

123 x 10 = 1230

The leading zeros in variable A are ignored.

set A = A MUL 2

A = 4294967295

4294967295 x 2 = 8589934590 = #

If the result is greater than 4294967295, the result is invalid (#).

set A = A MUL 5

A = #

# x 5 = #

The # character in a variable makes the result invalid (#).

set B = A MUL 10

Variable definitions:

  • A = 000123

  • B: collect type, length = 3, start = 2 (start is ignored)

123 x 10 = 1230 = #

The leading zeros are ignored in the operation. The result is greater than three digits, causing an overflow condition.