This option specifies whether to truncate upper digits in numeric characters when converting into binary (TRUNC), or to give priority to execution speed regarding truncation (NOTRUNC).
Item | Description | |
---|---|---|
Truncation of high-order digits when converting into binary items | Specifies whether to truncate the upper digits of numeric characters when converting to binary. The default is NOTRUNC. | |
TRUNC | Truncates the number of upper digits according to the PICTURE clause of the receiving-side item, and saves the resultant value in the receiving-side item. If this item is specified with the OPTIMIZE compile option, optimization truncates the number of upper digits of data items that are from zoned decimal items or packed decimal items. The number of upper digits is truncated as described above only if the number of digits in the integer part of the sending-side item is greater than that of the receiving-side item. | |
NOTRUNC | Gives priority to the object program execution speed. If the execution speed would be higher without truncation of the upper digits, the digits will not be truncated. |
Point
In the PICTURE clause:
Moving S999V9 (three-digit integer part) to S99V99 (two-digit integer part): The digits are truncated.
Moving S9V999 (one-digit integer part) to S99V99 (two-digit integer part): The digits are not truncated.
Note
If NOTRUNC is specified and the number of digits in the integer part of the sending-side item is greater than that of the receiving-side item, the results are not defined.
To specify NOTRUNC, the applicable program must be designed such that no value exceeding the digit number in the PICTURE clause is stored in the receiving-side item, even if the truncation of digits is not applied.
The criteria for whether to truncate the digits in cases where NOTRUNC is specified are different for different compilers. The compatibility with another system is not guaranteed for a program that depends on the specification of NOTRUNC to suppress truncation.