skip to main content

Procedure Division Statements : MULTIPLY

MULTIPLY
General Format
Format 1
MULTIPLY {Identifier-1} BY { Identifier-2 [ROUNDED]  } ... 
  [ ON SIZE ERROR Imperative-Statement-1 ] 
  [ NOT ON SIZE ERROR Imperative-Statement-2 ] 
  [END-MULTIPLY]
Format 2
MULTIPLY {Identifier-1} BY {Identifier-2}
  GIVING { Identifier-3 [ROUNDED] } ... 
  [ ON SIZE ERROR Imperative-Statement-1 ] 
  [ NOT ON SIZE ERROR Imperative-Statement-2 ] 
  [END-MULTIPLY]
Syntax rules
1.
2.
3.
General rules
1.
2.
Examples
Format 1 - Multiply literal or variable by variable
move 20   to ws-factor
move 10  to ws-age
multiply 2 by ws-age
multiply ws-factor by ws-age
         on size error display message "size error" 
move 10 to ws-age
move 20 to ws-age2
move 15 to ws-age3
multiply 2 by ws-age ws-age2
Format 1 - Rounding the result of the multiply
move     5.99     to ws-radius
multiply 3.141593 by ws-radius rounded
Format 2 - Rounding the result of the multiply and placing result on different variable
move     5.99     to ws-radius
multiply 3.141593 by ws-radius rounded
  giving ws-result

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left