A size error condition can occur in four different ways:
X 01 WINDOWED-YEAR DATE FORMAT YY PICTURE 99 X VALUE IS 50.
X .
X .
X .
X SUBTRACT 20 FROM WINDOWED-YEAR X ON SIZE ERROR imperative-statement
Table 34. Exponentiation Size Error Conditions | ||
Size error |
Action taken when a SIZE ERROR clause is present |
Action taken when a SIZE ERROR clause is not present |
---|---|---|
Zero raised to zero power |
The SIZE ERROR imperative is executed. |
The value returned is 1, and a message is issued. |
Zero raised to a negative number |
The SIZE ERROR imperative is executed. |
Program is terminated abnormally. |
A negative number raised to a fractional power |
The SIZE ERROR imperative is executed. |
The absolute value of the base is used, and a message is issued. |
The size error condition applies only to final results, not to any intermediate results.
If the resultant identifier is defined with USAGE IS BINARY,
If the ROUNDED phrase is specified, rounding takes place before size error checking.
When a size error occurs, the subsequent action of the program depends on whether or not the ON SIZE ERROR phrase is specified.
If the ON SIZE ERROR phrase is not specified and a size error condition occurs, truncation rules apply and the value of the affected resultant identifier is computed.
If the ON SIZE ERROR phrase is specified and a size error condition occurs, the value of the resultant identifier affected by the size error is not altered--that is, the error results are not placed in the receiving identifier. After completion of the execution of the arithmetic operation, the imperative statement in the ON SIZE ERROR phrase is executed, control is transferred to the end of the arithmetic statement, and the NOT ON SIZE ERROR phrase, if specified, is ignored.
For ADD CORRESPONDING and SUBTRACT CORRESPONDING statements, if an individual arithmetic operation causes a size error condition, the ON SIZE ERROR imperative statement is not executed until all the individual additions or subtractions have been completed.
If the NOT ON SIZE ERROR phrase has been specified and, after execution of an arithmetic operation, a size error condition does not exist, the NOT ON SIZE ERROR phrase is executed.
When both ON SIZE ERROR and NOT ON SIZE ERROR phrases are specified, and the statement in the phrase that is executed does not contain any explicit transfer of control, then, if necessary, an implicit transfer of control is made after execution of the phrase to the end of the arithmetic statement.
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.