ZONEDATA
- Default
- ZONEDATA(PFD)
- Recommended
- When the
data in
USAGE DISPLAY
andPACKED-DECIMAL
data 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
the sign code, digits or zone bits
are invalid.
- Reasoning
- When the ZONEDATA(PFD) option is in effect, the compiler
assumes
that the
data in
USAGE DISPLAY
andPACKED-DECIMAL
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
numeric
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
, the invalid sign code and the invalid digits
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
when 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.
- When the ZONEDATA(PFD) option is in effect, the compiler
assumes
that the
- 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.