Overflow Behavior

The following table describes the overflow behavior when a packed decimal number is assigned to a smaller target. An exception is not generated when:
  • A packed decimal is assigned to a smaller target with integral type.
  • A packed decimal is assigned to a smaller target of floating point type.

An exception is generated when a packed decimal is assigned to a smaller packed decimal target. You can suppress runtime errors by using the #pragma nosigtrunc directive in your ILE C source code.

Table 1. Handling Overflow from a Packed Decimal to a Smaller Target
From Field To Field Runtime Error
Packed Decimal char, int, short, long, long long, bit No
Packed Decimal Packed Decimal Yes
Packed Decimal Float No2
Packed Decimal Double No1, 2
Note:
  1. There is no packed decimal number large enough to cause overflow when the packed decimal is assigned to a double.
  2. If you use the MI instruction setca to unmask a floating point exception, you receive an error message MCH1213 for a floating point inexact result.