A fix is available
APAR status
Closed as new function.
Error description
New Function ZONEDATA(NOPFD).
Local fix
N/A
Problem summary
**************************************************************** * USERS AFFECTED: Users of Enterprise COBOL V5.1 migrating * * from earlier COBOL compilers, where they * * were using NUMPROC(NOPFD|PFD), when there * * are invalid zone bits in USAGE DISPLAY * * numeric (zoned decimal) data items that are * * also used in numeric comparisons. * * * **************************************************************** * PROBLEM DESCRIPTION: Incorret output: * * Numeric comparisons got different * * results in COBOL V5 than previous * * versions if users recompile programs * * that have: * * - USAGE DISPLAY numeric data items that * * contain bad zone bits and have * * - numeric comparisons using such data * * items * * * **************************************************************** * RECOMMENDATION: Apply the provided PTF and compile with the * * new ZONEDATA(NOPFD) compiler option * * * **************************************************************** The compiler was assuming that the zone bits were valid so that comparisons could be done with instructions that were optimized to string compares rather than instructions to convert to numeric and do numeric compares in relation conditions.
Problem conclusion
Temporary fix
Comments
The compiler was changed to add a new compiler option, to address this challenge. This APAR adds the ZONEDATA(NOPFD) compiler option. With ZONEDATA(NOPFD), COBOL V5 will behave like COBOL V4 when NUMPROC(NOPFD|PFD) was used. The same NUMPROC option used in COBOL V4 should also be used in COBOL V5. Users who used NUMPROC(MIG) in COBOL V4 should instead use ZONEDATA(MIG) if they have invalid zone bits in USAGE DISPLAY numeric (zoned decimal) data items. +--------------------------------------------------------------+ | Start of changes for: | | Enterprise COBOL for z/OS Programming Guide, SC14-7382-01 | Chapter 17: Compiler options Add the NOPFD suboption to the ZONEDATA compiler option: ZONEDATA(PFD|MIG|NOPFD) This compiler option tells the compiler whether USAGE DISPLAY numeric data items(zoned decimal) will contain data with valid zone bits (PFD) or may contain data with invalid zone bits (MIG) for numeric comparisons. +--PFD--+ | | >>---ZONEDATA--(-+--MIG--+-)--->> | | +-NOPFD-+ Default: ZONEDATA(PFD) Abbreviations: ZD Each digit of a valid zoned decimal number is represented by a single byte X'F0' through X'F9'. The 4 high-order bits of each byte are zone bits . The 4 low-order bits of each byte contain the value of the digit. The 4 high-order bits of the low-order byte (for SIGN TRAILING) represent the sign of the item. The sign is in the high-order byte with SIGN LEADING, or in a separate byte for SIGN IS SEPARATE. ZONEDATA(PFD) When the ZONEDATA(PFD) option is in effect, the compiler assumes that the zone bits in zoned 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. ZONEDATA(MIG) When the ZONEDATA(MIG) option 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. Start of change The compiler will also avoid performing known optimizations that might produce a different result than COBOL V4 when a zoned decimal data item has invalid zone bits. ZONEDATA(NOPFD) When the ZONEDATA(NOPFD) option is in effect, the compiler generates instructions for numeric comparisons of zoned decimal data in the same manners as COBOL V4 does: In the cases where COBOL V4 considered the zone bits, the numeric comparisons consider the zone bits of each digit in zoned decimal data items. The zoned decimal value remains as zoned decimal and a string comparison is used. In the cases where COBOL V4 ignored the zone bits, the numeric comparisons 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. The compiler will also avoid performing known optimizations that might produce a different result than COBOL V4 when a zoned decimal data item has invalid zone bits. Note: The sign zone must be a valid sign according to the NUMPROC compiler option setting. In addition, the low-order byte must have a valid zone (x'F') for unsigned and signed with either SIGN IS LEADING or SIGN IS SEPARATE. | End of changes for: | | Enterprise COBOL for z/OS Programming Guide, SC14-7382-01 | +--------------------------------------------------------------+ +--------------------------------------------------------------+ | Start of changes for: | | Enterprise COBOL for z/OS Customization Guide, SC14-7380-01 | Chapter 2: Enterprise COBOL compiler options Add the NOPFD suboption to the ZONEDATA compiler option: Use the same descriptions as the Programming Guide except for for different syntax: +--PFD--+ | | >>---ZONEDATA=--+---+--+--MIG--+---->> | | | | +-*-+ +-NOPFD-+ Default: ZONEDATA=PFD Abbreviations: None | End of changes for: | | Enterprise COBOL for z/OS Customization Guide, SC14-7380-01 | +--------------------------------------------------------------+ +--------------------------------------------------------------+ | Start of changes for: | | Enterprise COBOL for z/OS Migration Guide, GC14-7383-03 | Chapter 15: Changes with IBM Enterprise COBOL for z/OS, Version 5 Compiler option changes in Enterprise COBOL Version 5 Add a description of ZONEDATA to table 30: ZONEDATA: New option in Enterprise COBOL V5.2. It tells the compiler whether USAGE DISPLAY numeric data items (zoned decimal) contain data with valid zone bits, and if not, what the behavior of the compiler should be. Originally, Enterprise COBOL V5.2 at base level did not have the NOPFD suboption. In V5.2, the NOPFD suboption is added to let the compiler generate code that performs comparisons of zoned decimal data in the same manner as COBOL V4 does when using NUMPROC(NOPFD|PFD) in COBOL V4. To ease your migration to COBOL V5: If your zone bits are valid, use ZONEDATA(PFD) and the same NUMPROC setting that you used with COBOL V4 when using COBOL V5. If you have invalid zone bits: If you used NUMPROC(MIG) with COBOL V4, use ZONEDATA(MIG) and NUMPROC(NOPFD) with COBOL V5. If you used NUMPROC(NOPFD) with COBOL V4, use ZONEDATA(NOPFD) and NUMPROC(NOPFD) with COBOL V5. If you used NUMPROC(PFD) in COBOL V4, use ZONEDATA(NOPFD) and NUMPROC(PFD) in COBOL V5. | End of changes for: | | Enterprise COBOL for z/OS Migration Guide, GC14-7383-03 | +--------------------------------------------------------------+
APAR Information
APAR number
PI37270
Reported component name
ENT COBOL FOR Z
Reported component ID
5655W3200
Reported release
510
Status
CLOSED UR1
PE
NoPE
HIPER
NoHIPER
Special Attention
YesSpecatt / New Function
Submitted date
2015-03-18
Closed date
2015-06-17
Last modified date
2015-07-01
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Modules/Macros
IGYCBE
SC14738001 |
Fix information
Fixed component name
ENT COBOL FOR Z
Fixed component ID
5655W3200
Applicable component levels
R510 PSY UI28607
UP15/06/25 P F506
Fix is available
Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SS6SG3","label":"Enterprise COBOL for z\/OS"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"5.1","Edition":"","Line of Business":{"code":"LOB17","label":"Mainframe TPS"}},{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M","label":"APARs - z\/OS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"5.1","Edition":"","Line of Business":{"code":"","label":""}}]
Document Information
Modified date:
01 July 2015