IBM Support

PH51996: 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

Problem summary

  • ****************************************************************
    * USERS AFFECTED: Users of Enterprise COBOL 6.3 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

    PH51996

  • Reported component name

    ENT COBOL FOR Z

  • Reported component ID

    5655EC600

  • Reported release

    630

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2023-01-18

  • Closed date

    2023-03-16

  • Last modified date

    2023-04-03

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

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

    PH52707 UI90994 UI90995 UI90996

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 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

  • R630 PSY UI90994

       UP23/03/28 P F303

  • R631 PSY UI90995

       UP23/03/28 P F303

  • R632 PSY UI90996

       UP23/03/28 P F303

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":"630","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
12 December 2023