IBM Support

LI73304: CASTING OF A ROUND FUNCTION TO A DECIMAL CAN PRODUCE INCONSISTENT RESULTS ON WINDOWS OPERATING SYSTEMS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • On Windows operating systems, you can get inconsistent results
    when casting to a decimal datatype the results of a round
    function that is part of a division that uses a double function.
    The following examples show a sequence of operations that can
    produce inconsistent results:
    
    Example 1 with correct result generated: db2 values ( cast
    (round(185 / double(365), 0) as DEC(7)) )
    
    Example 2 with incorrect result generated: db2 values ( cast
    (round(186 / double(365), 0) as DEC(7)) )
    
    Example 3 with correct result generated: db2 values ( cast
    (round(187 / double(365), 0) as  DEC(7)) )
    

Local fix

  • To correct the problem:
    1) Do not cast as decimal .
    2) Cast as dec(31,30).  For example, db2 values (
    cast(round(186/double(365), 0) as dec(31,30)) )
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All users                                                    *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See the Error Description field.                             *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 version 9.1.0.6.                              *
    ****************************************************************
    On Windows operating systems, you can get inconsistent results
    when casting to a decimal datatype the results of a round
    function that is part of a division that uses a double
    function.The following examples show a sequence of operations
    that can   produce inconsistent results.
    

Problem conclusion

  • The problem is first fixed in DB2 version 9.1.0.6.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI73304

  • Reported component name

    DB2 UDE ESE LIN

  • Reported component ID

    5765F4104

  • Reported release

    910

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2008-04-04

  • Closed date

    2013-12-09

  • Last modified date

    2013-12-09

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

    LI73290

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

Fix information

  • Fixed component name

    DB2 UDE ESE LIN

  • Fixed component ID

    5765F4104

Applicable component levels

  • R910 PSN

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"910","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
15 October 2021