SIZE condition

Indicates that the value of a data item exceeds the declared or default size of the data item.
Important: Because its usage has the potential to negatively affect performance, use SIZE only during application development, and remove it for production usage.

Enabled/Disabled status

Always disabled.

Result

Assignment is undefined.

Raised

When the size of the value being assigned to a data item exceeds the declared or default size of the data item, even when the size of the storage and the amount of storage used by the data item are different. For example, a fixed binary item of precision (20) occupies a fullword in storage, but SIZE is raised if a value whose size exceeds FIXED BINARY(20) is assigned to it.

When high-order (i.e., leftmost) significant binary or decimal digits are lost in an attempted assignment to a variable, an intermediate result, or in an input/output operation. This loss can result from conversion of different data types, bases, scales, or precisions. When disabled, any non-inline conversion might cause the condition to be raised.

Notes

The SIZE condition is disabled by default. Because Open PL/I does not support condition prefixes, which is the language mechanism by which this behavior is enabled, an alternative method is provided.

In optimized code, FIXEDOVERFLOW might be raised instead of SIZE.

Use the SIZE condition primarily for program testing because the overhead it uses to check sizes in both storage space and run time can be significant.

The SIZE condition and the FIXEDOVERFLOW condition are different in that FIXEDOVERFLOW is raised when the size of a calculated fixed-point value exceeds the maximum allowed by the implementation, and SIZE is raised on assignment of a value regardless of whether or not FIXEDOVERFLOW was raised in the calculation of that value.

If the SIZE condition is raised, but it is also disabled, the program is in error.

Example

The following Open-PLI run-time call is exposed as built-in subroutine:

dcl __mFp_set_size_condition entry(fixed bin(31) native) external('__mFp_set_size_condition');
call __mFp_set_size_condition (1);  /*  enables the SIZE condition */
call __mFp_set_size_condition (0);  /*  disables the SIZE condition */

Other Information

Condition codes
340, 341
Implicit action
Prints a message and raises the ERROR condition.
Normal return
Control is returned to the point immediately after the point at which the condition was raised.