COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
imperative-stmt-2
is an imperative statement for the process to execute if it does not detect a size error in the
division or in storing the result.
END-DIVIDE
ends the scope of the DIVIDE statement and makes it a delimited-scope statement. If you omit
END-DIVIDE but include the SIZE ERROR or NOT SIZE ERROR phrase, the DIVIDE statement is
a conditional statement and ends at the next period separator.
Usage Considerations:
• Mathematics
The statement
DIVIDE A INTO B GIVING C REMAINDER D
means store the quotient portion of the value of B /A in C and store the remainder in D.
The statement
DIVIDE A BY B GIVING C REMAINDER D
means store the quotient portion of the value of A /B in C, and store the remainder in D.
• Precision
For a discussion of the precision of HP COBOL division, see Arithmetic Precision (page 261).
• Remainder
HP COBOL computes the remainder by performing the division with a signed quotient having
the same number of decimal places as the quotient. For example, dividing 2 into -5 yields a
remainder of -1. This differs from COBOL, in which the intermediate value has the same sign
as the quotient.
318 Procedure Division Verbs










