IBM Support

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

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

Problem conclusion

  • First fixed in DB2 UDB Version 9.5, FixPak 2
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI73307

  • Reported component name

    DB2 UDE ESE LIN

  • Reported component ID

    5765F4104

  • Reported release

    950

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2008-04-04

  • Closed date

    2008-11-10

  • Last modified date

    2008-11-10

  • 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

  • R950 PSY UP

       LI73307

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"950","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
10 November 2008