IBM Support

II09058: INCOMPATIBLE COMPARISON FOR DATA TYPE-DECIMAL ON DB2/MVS VS. THE DOUBLE PRECISION HOST VARIABLE ON WORKSTATION C++.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as canceled.

Error description

  • This INFO APAR will document the incompatible data type
    comparison for Data Type-DECIMAL on Host vs. the
    Double Precision host variable on Workstation C++.
    .
    .
    The problem occurs when comparing 2 floating point numbers, one
    converted from a decimal column in the DB2/MVS or DB2/VM table,
    another converted from an 8 byte double precision floating point
    number coming from a C application on the PC. The difference is
    in the very last bit in the number being represented. For some
    floating point numbers, the number coming from the PC is larger
    by the last significant bit. This could have to do with how the
    IEEE floating point format is defined as compared to the 370
    floating point numbers. For example;
    
    (1) On the PC side:
    1240.21 ---> A4703D0A D7609340 for IEEE floating point
                 representation.
            ---> 434D835C 28F5C290 converted to 370 floating point
                 from IEEE floating point representation.
    
    (2) On the 370 side:
    1240.21 (Decimal 13,2) ---> 434D835C 28F5C28F for 370 floating
                                point representation.
    So even though the 2 numbers are very close, but they are not
    equal. Therefore, the EQUAL predicate in the WHERE Clause from a
    SELECT of the table on host could not be satisfied in this case.
    .
    Possible solutions:
    (1) Use Workstation COBOL with DECIMAL host variables.
    (2) DB2/MVS V4 has a conversion function that will
       convert CHAR (Char. representation of a decimal number)
       variables to decimal.
    e.g.        COL1  = DECIMAL(:HV,13,2)   <V4.1 only>
           CHAR(COL1) =         :HV
         DIGITS(COL1) =         :HV
    Note: column = expression  and  expression = value are not
    indexable (see DB2 Admin Guide (SC26-4888-00 page 7-235,
    Table 171. Predicate Types and Processing)
    ...
     --See V4 DB2 SQL Reference (SC26-3270-00) for DECIMAL and
     DIGITS or CHAR Scalar Functions.
    
    (3) The application program could use SQLDA with SQLTYPE 484/485
        to specify a decimal value (conversion to a C language data
        type would have to be handled by the application).
           See DB2/MVS V3.1 SQL REFERENCE APPENDIX C P405 and
        APPLICATION PROGRAMMING GUIDE P3-47 to 3-57 for SQLDA and C
        coding guidelines. For DB2/VM refer to DB2/VM V3.4
        APPLICATION PROGRAMMING MANUAL P282 in APPENDIX B.
    ...
    ...
    Additional Search Arguments: DB2 5740xyr00 r230 r310 r410
    

Local fix

Problem summary

Problem conclusion

Temporary fix

Comments

  • close for Internet viewing
    

APAR Information

  • APAR number

    II09058

  • Reported component name

    PB LIB INFO ITE

  • Reported component ID

    INFOPBLIB

  • Reported release

    001

  • Status

    CLOSED CAN

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    1995-11-14

  • Closed date

    1997-11-03

  • Last modified date

    1997-11-03

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

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

Fix information

Applicable component levels

[{"Business Unit":{"code":null,"label":null},"Product":{"code":"SG19O","label":"APARs - MVS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"001","Edition":"","Line of Business":{"code":"","label":""}},{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEPEK","label":"Db2 for z\/OS"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"001","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
03 November 1997