Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Programming Guide

DECIMAL

The DECIMAL option specifies how the compiler should handle certain FIXED DECIMAL operations and assignments.

Read syntax diagramSkip visual syntax diagram               .-,--------------------.
               V   .-FOFLONASGN---.   |
>>-DECIMAL--(----+-+-NOFOFLONASGN-+-+-+--)---------------------><
                 | .-NOFOFLONMULT-. |
                 +-+-FOFLONMULT---+-+
                 | .-NOFORCEDSIGN-. |
                 '-+-FORCEDSIGN---+-'
 

FOFLONASGN
The FOFLONASGN option requires the compiler to generate code that will raise the FIXEDOVERFLOW condition, if it is enabled and the SIZE condition is disabled, whenever a FIXED DECIMAL expression is assigned to a FIXED DECIMAL target and significant digits are lost.

Conversely, under the NOFOFLONASGN option, the compiler will generate code that will not raise the FIXEDOVERFLOW condition when significant digits are lost in such an assignment.

So, for example, given a variable A declared as FIXED DEC(5), the assignment A = A + 1 might raise FOFL under the FOFLONASGN option, but would never raise it under the NOFOFLONASGN option.

Note, however, that under the NOFOFLONASGN option, the FIXEDOVERFLOW condition can still be raised by operations that produce a result with more digits than allowed by the FIXEDDEC suboption of the LIMITS option. For example, given a variable B declared as FIXED DEC(15) with the value 999_999_999_999_999 and given that the FIXEDDEC suboption of the LIMITS specifies the maximum precision as 15, then the assignment B = B + 1 will raise the FIXEDOVERFLOW condition (if FOFL is enabled, of course) since the addition B + 1 will raise the condition.

FOFLONMULT
The FOFLONMULT option requires the compiler to generate code that will raise the FIXEDOVERFLOW condition for any use of the MULTIPLY built-in function that would produce a FIXED DEC result that is too large for the precision specified in the built-in function.

Conversely, under the NOFOFLONMULT option, the compiler will generate code that will produce a truncated result for any such use of the MULTIPLY built-in function.

Note that the use of the FOFLONMULT option changes the default language semantics (which would be to truncate a too large result of the MULTIPLY built-in function applied to FIXED DEC - unless the SIZE condition were enabled).

FORCEDSIGN
The FORCEDSIGN option will force the compiler to generate extra code to insure that whenever a FIXED DECIMAL result with the value zero is generated, the sign nibble of the result will have the value ’C’X. This option can cause the compiler to generate code that will perform much, much worse than the code generated under the NOFORCEDSIGN suboption.

Also, when this option is in effect, more data exceptions may occur when you run program. For example, if you assign one FIXED DEC(5) variable to another FIXED DEC(5) variable, the compiler would normally generate a MVC instruction to perform the move. However if this option is in effect, in order to insure that the result has the preferred sign, the compiler will generate a ZAP instruction to perform the move. If the source contains invalid packed decimal data, the ZAP instruction, but not the MVC instruction, will raise a decimal data exception.

Under this option, data exceptions may also be raised when one PICTURE variable is assigned to another PICTURE variable since that conversion usually involves an implicit conversion to FIXED DEC which, under this option, will generate a ZAP instruction that will raise a data exception if the source contains invalid data.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)