Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

6.2.25 MULTIPLY Statement



The MULTIPLY statement multiplies numeric items and sets the values of data items equal to the results.


    ___ Format 1 ___________________________________________________________ 
   |                                                                        |
   |                                     <___________________________       |
   | >>__MULTIPLY__ _identifier-1_ __BY____identifier-2__ _________ _|____> |
   |               |_literal-1____|                      |_ROUNDED_|        |
   |                                                                        |
   | >__ ____________________________________________ ____________________> |
   |    |_ ____ __SIZE ERROR__imperative-statement-1_|                      |
   |      |_ON_|                                                            |
   |                                                                        |
   | >__ _________________________________________________ _______________> |
   |    |_NOT__ ____ __SIZE ERROR__imperative-statement-2_|                 |
   |           |_ON_|                                                       |
   |                                                                        |
   | >__ ______________ _________________________________________________>< |
   |    |_END-MULTIPLY_|                                                    |
   |                                                                        |
   |________________________________________________________________________|
In Format 1, the value of identifier-1 or literal-1 is multiplied by the value of identifier-2; the product is then placed in identifier-2. For each successive occurrence of identifier-2, the multiplication takes place in the left-to-right order in which identifier-2 is specified.


    ___ Format 2 ___________________________________________________________ 
   |                                                                        |
   | >>__MULTIPLY__ _identifier-1_ __BY__ _identifier-2_ _________________> |
   |               |_literal-1____|      |_literal-2____|                   |
   |                                                                        |
   |            <___________________________                                |
   | >__GIVING____identifier-3__ _________ _|_____________________________> |
   |                            |_ROUNDED_|                                 |
   |                                                                        |
   | >__ ____________________________________________ ____________________> |
   |    |_ ____ __SIZE ERROR__imperative-statement-1_|                      |
   |      |_ON_|                                                            |
   |                                                                        |
   | >__ _________________________________________________ _______________> |
   |    |_NOT__ ____ __SIZE ERROR__imperative-statement-2_|                 |
   |           |_ON_|                                                       |
   |                                                                        |
   | >__ ______________ _________________________________________________>< |
   |    |_END-MULTIPLY_|                                                    |
   |                                                                        |
   |________________________________________________________________________|
In Format 2, the value of identifier-1 or literal-1 is multiplied by the value of identifier-2 or literal-2. The product is then stored in the data item(s) referenced by identifier-3.

For all Formats:

identifier-1, identifier-2

X Must name an elementary numeric item. Identifier-1 and identifier-2
X cannot be date fields.

literal-1, literal-2
Must be a numeric literal.

For Format-2:

identifier-3
Must name an elementary numeric or numeric-edited item.


X Identifier-3, the GIVING phrase identifier, is the only identifier in
X the MULTIPLY statement that can be a date field.


X If identifier-3 names a date field, then see "Storing Arithmetic
X Results That Involve Date Fields" in topic 6.1.5.2.3 for details on
X how the product is stored in identifier-3.


X Floating-point data items and literals can be used anywhere a numeric data
X item or literal can be specified.

The composite of operands must not contain more than 18 digits.


X The composite of operands can be more than 18 digits. For information on
X arithmetic intermediate results, see the IBM COBOL Programming Guide for
X your platform.

Subtopics:



Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.