The DIVIDE statement performs arithmetic division.

DIVIDEdivisorINTO{ result [ROUNDED] } ... [ ONSIZEERRORstatement ] [NOTONSIZEERRORstatement ] [END-DIVIDE]

DIVIDEdivisorINTOdividendGIVING{ result [ROUNDED] } ... [ ONSIZEERRORstatement ] [NOTON SIZEERRORstatement ] [END-DIVIDE]

DIVIDEdividendBYdivisorGIVING{ result [ROUNDED] } ... [ ONSIZEERRORstatement ] [NOTONSIZEERRORstatement ] [END-DIVIDE]

DIVIDEdivisorINTOdividendGIVINGresult [ROUNDED]REMAINDERremainder [ ONSIZEERRORstatement ] [NOTONSIZEERRORstatement ] [END-DIVIDE]

DIVIDEdividendBYdivisorGIVINGresult [ROUNDED]REMAINDERremainder [ ONSIZEERRORstatement ] [NOTONSIZEERRORstatement ] [END-DIVIDE]

`divisor`is a numeric literal or numeric data item. It represents the number to be divided by.`dividend`is a numeric literal or numeric data item. It represents the number to be divided into.`result`is a numeric or`numeric-edited`data item. In Format 1, result must be a numeric data item.`remainder`is a numeric or numeric-edited data item.`statement`is an imperative statement.- The REMAINDER phrase may not be used if any operand or result is an external floating-point data type.

Note: Avoid mixing external floating-point types with other numeric types in DIVIDE statements, because mixed-type DIVIDE operations
are not completely reliable.

The divisor is individually divided into each result and the quotient stored there.

The divisor is divided into the dividend. The quotient is stored in each result.

- The divisor is divided into the dividend, the quotient is stored in result, and the remainder is stored in remainder.
- If the ROUNDED phrase is not specified, the quotient is truncated to fit into the result and the remainder is computed by subtracting the product of the truncated quotient and divisor from the dividend. If the ROUNDED phrase is specified, the quotient is rounded to fit the result, but the remainder is still computed by subtracting the product of the truncated quotient and the divisor from the dividend.
- If the SIZE ERROR clause is specified, and a size error occurs during the computation of the quotient, the remainder is not
computed and remainder remains unchanged. If a size error occurs during the computation of the remainder, the result is updated,
but the remainder is left unchanged. The SIZE ERROR statement executes in either case.
Note: In division operations, the remainder is calculated before the quotient is moved to the destination item(s).
The remainder will almost always be 0 if the dividend or divisor is floating-point. This is because all of the arithmetic is performed using floating-point variables. The remainder will be non-zero only if precision is lost during the calculation.

- Additional information can be found in Arithmetic Operations, Multiple Receiving Fields, the ROUNDED Option, and the SIZE ERROR Option.