ZONEDATA
The ZONEDATA
option tells
the compiler whether the data in USAGE DISPLAY
and PACKED-DECIMAL
data
items is valid, and if not, what the behavior of the compiler should
be.
USAGE
DISPLAY
and USAGE PACKED-DECIMAL
data items,
most users should use ZONEDATA=PFD
. Even if you find
that your programs are processing invalid data at run time (using
the NUMCHECK
compiler option), you should change
your programs to avoid processing invalid data, and use ZONEDATA=PFD
.ZONEDATA=PFD -> NOINVDATA
ZONEDATA=NOPFD -> INVDATA(NOFORCENUMCMP,CLEANSIGN)
ZONEDATA=MIG -> INVDATA(FORCENUMCMP,CLEANSIGN)
- Default
ZONEDATA=PFD
- PFD
- When
ZONEDATA=PFD
is in effect, the compiler assumes that all data inUSAGE DISPLAY
andPACKED-DECIMAL
data items is 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. - MIG
- When
ZONEDATA=MIG
is in effect, the compiler generates instructions to do numeric comparisons that ignore the zone bits of each digit in zoned decimal data items. For example, the zoned decimal value is converted to packed-decimal with a pack instruction before the comparison. The compiler will also avoid performing known optimizations that might produce a different result than COBOL V4 (or earlier versions) 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. - NOPFD
- When
ZONEDATA=NOPFD
is in effect, the compiler generates instructions for numeric comparisons or an alphanumeric comparison of zoned decimal data in the same manner as COBOL V4 (or earlier versions) does when usingNUMPROC=NOPFD|PFD
with COBOL V4 (or earlier versions):- In the cases where COBOL V4 (or earlier versions) considered the zone bits, the compiler generates an alphanumeric comparison which will also consider the zone bits of each digit in zoned decimal data items. The zoned decimal value remains as zoned decimal.
- In the cases where COBOL V4 ignored the zone bits, the
compiler generates numeric comparisons that ignore the zone bits
of each digit in zoned decimal data items. The zoned decimal value
is converted to packed-decimal with a
PACK
instruction before the comparison.
In order for the compiler to handle zone bits in the same way as COBOL V4 (or earlier versions) did when generating comparisons of zoned decimal data, theNUMPROC
suboption used in COBOL V6 must match theNUMPROC
suboption used in COBOL V4 (or earlier versions):- To get the COBOL V4 (or earlier versions)
NUMPROC=NOPFD
behavior in COBOL V6, useZONEDATA=NOPFD
andNUMPROC=NOPFD
in COBOL V6. - To get the COBOL V4 (or earlier versions)
NUMPROC=PFD
behavior in COBOL V6, useZONEDATA=NOPFD
andNUMPROC=PFD
in COBOL V6.
The compiler will also avoid performing known optimizations that might produce a different result than COBOL V4 (or earlier versions) 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.
Note: The sign code must be a valid sign code according to theNUMPROC
compiler option setting. In addition, the low-order byte must have a valid zone (x'F'
) for unsigned and signed with eitherSIGN IS LEADING
orSIGN IS SEPARATE
.
- If your digits, sign codes, and zone bits are
valid, use
ZONEDATA=PFD
and the sameNUMPROC
setting that you used with COBOL V4 when using COBOL V6. - If you have invalid digits, invalid sign codes,
or invalid zone bits in your data, change your programs or systems
so that your programs do not have invalid data in numeric data items
at run time.
Once you have corrected your programs or systems, you can use the preferred
ZONEDATA=PFD
option. Only if you cannot contain this work and must continue to run with invalid data, consider the following choices forZONEDATA
:- If you used
NUMPROC=MIG
with COBOL V4, useZONEDATA=MIG
andNUMPROC=NOPFD
with COBOL V6. - If you used
NUMPROC=NOPFD
with COBOL V4, useZONEDATA=NOPFD
andNUMPROC=NOPFD
with COBOL V6. - If you used
NUMPROC=PFD
with COBOL V4, useZONEDATA=NOPFD
andNUMPROC=PFD
with COBOL V6.
- If you used
ZONEDATA=NOPFD
isn't
going to give the same result in all cases as COBOL V4.Performance consideration:ZONEDATA=PFD
gives
better runtime performance than ZONEDATA=NOPFD|MIG
does. ZONEDATA=NOPFD|MIG
disables
some of the optimizations that NUMPROC=PFD
can give.