IBM Support

PH53882: UNEXPECTED BEHAVIOR WHEN USING ARITH(EXTEND) WITH EXPONENTIATION

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When performing calculations of R ** S, a base number raised to
    a fractional power, behavior is different between using
    ARITH(EXTEND) and ARITH(COMPAT) in certain cases:
    - Zero raised to zero power >> Without SIZE ERROR clause, the
    value returned is 1, and a message is issued.  However, with
    ARITH(EXTEND), result is CEE2020E.
    - A negative number raised to a fractional power  >>  Without
    SIZE ERROR, the absolute value of the base is used, and a
    message is issued.  With ARITH(EXTEND), result is CEE2006E.
    

Local fix

  • Compile with ARITH(COMPAT), or use ON SIZE ERROR phrase
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: Users of Enterprise COBOL 5 and later        *
    *                 releases running programs compiled           *
    *                 with ARITH(EXTEND) and using                 *
    *                 COMP-2 data types to perform                 *
    *                 exponentiation calculations.                 *
    ****************************************************************
    * PROBLEM DESCRIPTION: When the On Size Error clause is not    *
    *                      defined, results from exponentiation    *
    *                      calculations for programs compiled with *
    *                      ARITH(EXTEND) behave differently from   *
    *                      programs compiled with ARITH(COMPAT)    *
    *                      by producing LE error messages in       *
    *                      cases where COBOL Runtime warning or    *
    *                      error messages are expected.            *
    ****************************************************************
    * RECOMMENDATION: Install the provided PTF.                    *
    ****************************************************************
    There was a logic error in the COBOL Runtime routine for
    performing exponentiation calculations using COMP-2 in
    three cases. When exponentiation calculations were performed
    using COMP-2 without ON SIZE ERROR, the exponentiation
    behaviour differed between ARITH(COMPAT) and
    ARITH(EXTEND) in 3 cases.
    
    Case 1 - Base = negative, Power = fractional (eg: 1.24)
    Case 2 - Base = zero, Power = zero
    Case 3 - Base = zero, Power = negative
    
    In the cases listed above, LE error messages were
    incorrectly generated causing the program to end.
    The correct behavior is that the following
    Run-time messages are generated for these cases:
    
    Case 1 - IGZ0048W
    Case 2 - IGZ0049W
    Case 3 - IGZ0050S
    
    COB0501T/K COB0502T/K COB0601T/K COB0602T/K COB0603T/K
    COB0604T/K
    

Problem conclusion

  • The problem in the COBOL Runtime has been corrected.
    The problem was resolved by improving the logic used to
    perform exponentiation calculates. Now Run-time
    messages will be printed in these three cases:
    
    Case 1 - Base = negative, Power = fractional (eg: 1.24)
    Case 2 - Base = zero, Power = zero
    Case 3 - Base = zero, Power = negative
    
    This would ensure that ARITH(COMPAT) and
    ARITH(EXTEND) both have the same behavior when
    performing exponentiation calculation with COMP-2
    and without On Size Error.
    

Temporary fix

Comments

  • ×**** PE23/10/18 FIX IN ERROR. SEE APAR PH57638  FOR DESCRIPTION
    ×**** PE23/10/18 FIX IN ERROR. SEE APAR PH57638  FOR DESCRIPTION
    ×**** PE23/10/18 FIX IN ERROR. SEE APAR PH57638  FOR DESCRIPTION
    

APAR Information

  • APAR number

    PH53882

  • Reported component name

    LE ENT COBOL LI

  • Reported component ID

    568819812

  • Reported release

    7D0

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2023-04-12

  • Closed date

    2023-06-19

  • Last modified date

    2023-10-23

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

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

    UI92335 UI92336

Modules/Macros

  • IGZCEV4  IGZCJNI2 IGZLLIBV IGZXAPI  IGZXCA31 IGZXCDA  IGZXD24
    IGZXDMR  IGZXJNI2 IGZXLPIO IGZXLPKA IGZXLPKB IGZXLPKC IGZXLPKD
    IGZXLPKE IGZXLPKF IGZXLPKG IGZXPK2  IGZXQXPQ
    

Fix information

  • Fixed component name

    LE ENT COBOL LI

  • Fixed component ID

    568819812

Applicable component levels

  • R7C0 PSY UI92335

       UP23/06/28 P F306

  • R7D0 PSY UI92336

       UP23/06/28 P F306

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

Document Information

Modified date:
24 October 2023