The DECIMAL option specifies how the compiler should handle certain FIXED DECIMAL operations and assignments.
.-,--------------------. V .-FOFLONASGN---. | >>-DECIMAL--(----+-+-NOFOFLONASGN-+-+-+--)--------------------->< | .-NOFOFLONMULT-. | +-+-FOFLONMULT---+-+ | .-NOFORCEDSIGN-. | '-+-FORCEDSIGN---+-'
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.
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).
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.