Format 5 (DIVIDE BY, GIVING, with REMAINDER) ->->--DIVIDE--*--identifier-1--*--BY--*-identifier-2-*--------> *--literal-1-----* *-literal-2----* ->--GIVING identifier-3--*-----------*-----------------------> *--ROUNDED--* ->--REMAINDER identifier-4-----------------------------------> ->----*----------------------------------------------*-------> *--*----*---SIZE ERROR imperative-statement-1--* *-ON-* ->---*---------------------------------------------------*---> *-NOT---*----*---SIZE ERROR imperative-statement-2--* *-ON-* ->--*------------*-------------------------------------------><- *-END-DIVIDE-*
Identifier-1 and identifier-2 must name an elementary numeric item.
Literal must be a numeric literal.
Identifier-3 must name an elementary numeric or numeric-edited item.
Identifier-3 and identifier-4 must name an elementary numeric or numeric-edited item.
The quotient used to calculate the remainder is in an intermediate field. The value of the intermediate field is truncated rather than rounded.
The result of subtracting the product of the quotient and the divisor from the dividend is stored in identifier-4. If identifier-3, the quotient, is a numeric-edited item, the quotient used to calculate the remainder is an intermediate field that contains the unedited quotient.
Any subscripts for identifier-4 in the REMAINDER phrase are evaluated after the result of the divide operation is stored in identifier-3 of the GIVING phrase.
If a size error occurs in the quotient, no remainder calculation is meaningful. Therefore, the contents of the quotient field (identifier-3) and the remainder field (identifier-4) are unchanged.
If a size error occurs in the remainder, the contents of the remainder field (identifier-4) are unchanged.
In either of these cases, you must analyze the results to determine which situation has actually occurred.
Click here for more information about SIZE ERROR/NOT SIZE ERROR phrases.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.