IBM Support

PH52707: Comparison of unsigned to signed halfword binary items produces an incorrect result

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Under optimization with compile time evaluation of the compare,
    the optimizer treats the unsigned halfword (PIC 4(9) COMP-5)
    item as signed, perhaps leading to a
    
    IGYCB7300-W The code from lines nn.n in program 'program' was
            safely removed by the optimizer.
    
    compile time diagnostic, for example of the wrong clause of an
    if statement.
    
    At OPT(0), or OPT(1|2) where compile time evaluation is not
    possible, the unsigned operand is incorrectly loaded with a sign
    extending LH (LOAD HALFWORD) instruction.
    

Local fix

  • Use a fullword (PIC 9(9) COMP-5) unsigned item.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: Users of Enterprise COBOL 6.4 compiling and  *
    *                 running programs that contain a comparison   *
    *                 between two operands that meet the following *
    *                 conditions: 1) The operands are USAGE COMP-5 *
    *                 (or USAGE BINARY/COMP/COMP-4 and the program *
    *                 is compiled with the TRUNC(BIN) option). 2)  *
    *                 The operands have the same decimal and       *
    *                 integer precision. 3) One of the operands is *
    *                 signed and the other is unsigned. 4) The     *
    *                 value in the unsigned item has its           *
    *                 high-order bit set and the value in the      *
    *                 signed item is positive.                     *
    ****************************************************************
    * PROBLEM DESCRIPTION: Incorrect comparison result at run      *
    *                      time.                                   *
    ****************************************************************
    * RECOMMENDATION: Apply the IBM-provided PTF.                  *
    ****************************************************************
    Under very specific conditions, comparisons between two binary
    operands that have truncation at hardware boundaries (instead of
    decimal digit boundaries) and have different signedness
    properties were performed with an incorrect precision.
    

Problem conclusion

  • The compiler was updated to ensure that comparisons between
    binary operands with hardware, word-size based truncation and
    different signedness properties are always performed with the
    proper precision.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PH52707

  • Reported component name

    ENT COBOL FOR Z

  • Reported component ID

    5655EC600

  • Reported release

    640

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2023-02-17

  • Closed date

    2023-02-17

  • Last modified date

    2023-03-01

  • APAR is sysrouted FROM one or more of the following:

    PH51996

  • APAR is sysrouted TO one or more of the following:

Modules/Macros

  • IGY8RWTU IGYCASMB IGYCCBE  IGYCCCRT IGYCCICS IGYCCSRV IGYCDGEN
    IGYCDIAG IGYCDMAP IGYCEN$0 IGYCEN$1 IGYCEN$2 IGYCEN$3 IGYCEN$4
    IGYCEN$5 IGYCEN$8 IGYCEN$D IGYCEN$R IGYCFGEN IGYCFREE IGYCINIT
    IGYCJA$0 IGYCJA$1 IGYCJA$2 IGYCJA$3 IGYCJA$4 IGYCJA$5 IGYCJA$8
    IGYCJA$D IGYCJA$R IGYCJDM5 IGYCJDMB IGYCJDMJ IGYCJDMR IGYCJGEN
    IGYCLIBR IGYCLSTR IGYCLVL0 IGYCLVL1 IGYCLVL2 IGYCLVL3 IGYCLVL8
    IGYCMALL IGYCOSCN IGYCPGEN IGYCRCTL IGYCRDPR IGYCRDSC IGYCREAL
    IGYCRWT  IGYCSCAN IGYCSIMD IGYCUE$0 IGYCUE$1 IGYCUE$2 IGYCUE$3
    IGYCUE$4 IGYCUE$5 IGYCUE$8 IGYCUE$D IGYCUE$R IGYCXREF IGYDRV
    IGYEQCWI IGYMSGE  IGYMSGK  IGYMSGT  IGYQCBE  IGYQSPLT IGYZQEN6
    IGYZQENU IGYZQJP6 IGYZQJPN
    

Fix information

  • Fixed component name

    ENT COBOL FOR Z

  • Fixed component ID

    5655EC600

Applicable component levels

  • R640 PSY UI90599

       UP23/02/25 P F302

  • R641 PSY UI90600

       UP23/02/25 P F302

  • R642 PSY UI90601

       UP23/02/25 P F302

  • R64H PSY UI90602

       UP23/02/25 P F302

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"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"640","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
12 December 2023