4.4
COMMON OPTIONS
IN STATEMENTS
Three options appear frequently in the statement descriptions that follow:
4.4.1
ROUNDED OPTION
4.4.2
SIZE ERROR OPTION
60229400
ROUNDED, SIZE ERROR, and CORRESPONDING
Truncation occurs after decimal point alignment if the number of fractional
places in the result of an arithmetic operation is greater than the number of
fractional places provided for the result in the receiving item. Excess digits
are truncated according to the format of the item containing the result,
(result identifier). When rounding is requested, the absolute value of the
result is increased by 1 when the most significant digit of the excess is
greater than or equal to 5.
When the low-order integer positions in a result identifier are represented
in a PICTURE by the character P, rounding or truncation occurs relative
to
the rightmost integer position for which storage is allocated.
A size error condition exists if the value of a result exceeds the largest value
that can be contained in the associated result identifier after decimal point
alignment. The size error condition applies only to final results, except in
MULTIPLY and DNIDE statements where size error applies to the inter-
mediate results as well. Division by zero always causes a size error
condition.
If
ROUNDED is specified, rounding takes place before checking
for size error. When a size error condition occurs, subsequent action
depends on whether or not the SIZE ERROR option is specified.
If
SIZE ERROR is not specified and a size error condition occurs,
the value of the result identifier is unpredictable.
If
SIZE ERROR is specified and a size error condition occurs, the
previous value of the result identifier is not altered. After the
operation is completed, the imperative statement in the SIZE
ERROR option is executed.
For CORRESPONDING arithmetic operations, the imperative statement in
the SIZE ERROR clause is not executed until all individual additions or
subtractions are completed.
Invalid non-numeric data contained within a numerically defined field does
not constitute an ON SIZE error condition during arithmetic operations.
4-13
Need help?
Do you have a question about the 3300 and is the answer not in the manual?