IBM Support

PI97620: WHEN THE DIVIDEND IS REDEFINED AS THE QUOTIENT, A DIVIDE GIVING REMAINDER CAN GIVE THE WRONG REMAINDER

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When the dividend is redefined as the quotient, a DIVIDE GIVING
    REMAINDER can give the wrong remainder.  This occurs at all
    optimization levels.
    
    Example:
    When WSCD11-PRODUCT-ACCUM = +0195 and WSDC11-ELEVEN = +011:
    
    WORKING-STORAGE SECTION.
    01  WS.
        05  WSCD11-PRODUCT-ACCUM     PIC S9(4) COMP-3.
        05  WSCD11-QUOTIENT  REDEFINES WSCD11-PRODUCT-ACCUM    <==
    Note the REDEFINES
                                     PIC S9(4) COMP-3.
        05  WSCD11-REMAINDER         PIC S99 COMP-3.
        05  WSCD11-ELEVEN            PIC S999 COMP-3 VALUE +11.
    
    DIVIDE WSCD11-PRODUCT-ACCUM BY WSCD11-ELEVEN,
         GIVING WSCD11-QUOTIENT
          REMAINDER WSCD11-REMAINDER.
    
    Under COB V4.2, WSCD11-QUOTIENT = +0017
                    WSCD11-REMAINDER = +08
    
    Under COB V6.1, WSCD11-QUOTIENT = +0017
                    WSCD11-REMAINDER = -70 <= Incorrect
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED: Users of Enterprise COBOL 6.2 compiling and  *
    *                 running programs containing a DIVIDE         *
    *                 statement with GIVING and REMAINDER          *
    *                 phrases, where the data item receiving the   *
    *                 quotient overlaps in memory with the data    *
    *                 item containing the dividend or the data     *
    *                 item containing the divisor, assuming such   *
    *                 data items exist.                            *
    ****************************************************************
    * PROBLEM DESCRIPTION: Incorrect runtime result. The           *
    *                      remainder of the DIVIDE statement is    *
    *                      calculated incorrectly.                 *
    ****************************************************************
    * RECOMMENDATION: Apply the provided PTF.                      *
    ****************************************************************
    When the data item receiving the quotient overlapped with the
    data item containing the dividend or the data item containing
    the divisor, the compiler was using incorrect data to calculate
    the remainder of the DIVIDE statement.
    

Problem conclusion

  • The compiler was updated so that for DIVIDE statements with
    GIVING and REMAINDER phrases, if there is a possibility that
    the data item receiving the quotient can overlap with the data
    item containing the dividend or the data item containing the
    divisor, then the dividend and/or divisor values are stored in
    a temp so that they can be used later to correctly calculate
    the remainder of the DIVIDE statement.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI97620

  • Reported component name

    ENT COBOL FOR Z

  • Reported component ID

    5655EC600

  • Reported release

    620

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-05-04

  • Closed date

    2018-05-28

  • Last modified date

    2018-06-04

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

    PI94615

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

Modules/Macros

  • IGY8RWTU IGYCASMB IGYCCBE  IGYCCCRT IGYCCICS IGYCCSRV IGYCDGEN
    IGYCDIAG IGYCDMAP IGYCDOPT 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 IGYCLIBH IGYCLIBO IGYCLIBR IGYCLSTR
    IGYCLVL0 IGYCLVL1 IGYCLVL2 IGYCLVL3 IGYCLVL8 IGYCMALL IGYCOB2
    IGYCOPI  IGYCOPT  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  IGYZQDRV
    IGYZQENU IGYZQJPN
    

Fix information

  • Fixed component name

    ENT COBOL FOR Z

  • Fixed component ID

    5655EC600

Applicable component levels

  • R620 PSY UI56120

       UP18/06/01 P F805

  • R621 PSY UI56121

       UP18/06/01 P F805

  • R622 PSY UI56122

       UP18/06/01 P F805

  • R62H PSY UI56123

       UP18/06/01 P F805

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

Document Information

Modified date:
12 December 2023