DIVIDE
Short Reference
Syntax
DIVIDE dobj1 BY dobj2.
Effect
This instruction has the same effect as the instruction
COMPUTE dobj1 = dobj1 / dobj2.
The content of dobj1 is divided by the content of
dobj2 and the result is assigned to dobj1.
The data objects dobj1 and dobj2 have to be numeric. You cannot use
built-in functions or
functional methods. The
calculation type is determined like an arithmetic expression.
Note
Obsolete Form: DIVIDE-CORRESPONDING
Catchable Exceptions
CX_SY_ARITHMETIC_OVERFLOW
-
Cause: Overflow during arithmetic operation (type P)
Runtime Error: BCD_OVERFLOW (catchable)
-
Cause: Integer-overflow during division
Runtime Error: COMPUTE_INT_DIV_OVERFLOW (catchable)
CX_SY_CONVERSION_OVERFLOW
-
Cause: Overflow during arithmetic operation (type P, with specified length)
Runtime Error: BCD_FIELD_OVERFLOW (catchable)
CX_SY_ZERODIVIDE
-
Cause: Division by 0 (type P)
Runtime Error: BCD_ZERODIVIDE (catchable)
-
Cause: Division by 0 (type F)
Runtime Error: COMPUTE_FLOAT_ZERODIVIDE (catchable)
-
Cause: Division by 0 (type I)
Runtime Error: COMPUTE_INT_ZERODIVIDE (catchable)
Non-Catchable Exceptions
-
Cause: P-Field does not contain correct
BCD-formatRuntime Error: BCD_BADDATA