ZONEDATA

Default
ZONEDATA(PFD)
Recommended
When the Start of changedata in USAGE DISPLAY and PACKED-DECIMAL End of changedata items is valid, use ZONEDATA(PFD) to improve the performance of your application. See ZONEDATA in the Enterprise COBOL for z/OS® Programming Guide for details of how the compiler behaves when Start of changethe sign code, digits or zone bitsEnd of change are invalid.
Reasoning
  • When the ZONEDATA(PFD) option is in effect, the compiler assumes that the Start of changedata in USAGE DISPLAY and PACKED-DECIMAL End of change data items are valid, and generates the most efficient code possible to make numeric comparisons. For example, the compiler might generate a string comparison to avoid numeric conversion.
  • When the ZONEDATA(MIG) option is in effect, the compiler must generate additional instructions to do Start of changenumericEnd of change comparisons that ignore the zone bits of each digit in zoned decimal data items. For example, a zoned decimal value might be converted to packed-decimal with a PACK instruction before the comparison.
  • When the ZONEDATA(NOPFD) option is in effect, the V6 compiler must generate a sequence that treats the invalid zone bits Start of change, the invalid sign code and the invalid digitsEnd of change in the same way as the V4 compiler, even when that sequence is less efficient than another possible sequence.

If ZONEDATA(PFD) is not set, the compiler must also avoid performing known optimizations that might produce a different result than COBOL V4 Start of changewhen a zoned decimal or packed decimal data item has invalid digits or an invalid sign code, or when a zoned decimal data item has invalid zone bits.End of change

Source Example
01 A PIC S9(5)V9(2).
01 B PIC S9(7)V9(2).
COMPUTE B = A * 100

In this example, the multiplication is 40.3% faster with ZONEDATA(PFD) than ZONEDATA(MIG). With ZONEDATA(PFD), the compiler can use a shift instruction instead of a multiplication. With ZONEDATA(MIG) or ZONEDATA(NOPFD), it must perform the more expensive multiplication.

related references
ZONEDATA (Enterprise COBOL for z/OS Programming Guide)