Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003

    Unanswered: How to store infinity in FLOAT DB2 UDB


    I need to migrate tables from DB2 z/Os v8 to DB2 UDB v9.1 Linux.
    Some Z/Os tables have "infinity" values stored into FLOAT columns.

    Is there such "infinity" limit values in DB2 UDB (found no doc about that)?
    How can I handle such pseudo values in DB2 UDB LInux?

    Thanks for your help.

    Last edited by altura; 10-07-10 at 05:27.

  2. #2
    Join Date
    Jun 2003
    Toronto, Canada
    Provided Answers: 1
    You can use the new DECFLOAT data type, which I think supports infinity values.

  3. #3
    Join Date
    Jan 2003
    It seems the infinity value is only dedicated to DECFLOAT and not FLOAT, right?
    My DB2 UDB Linux version is not compliant with DECFLOAT column (db2 linux 9.1).
    So, I need to find a way to manage infinity in FLOAT data type.

    Another question, On DB2 Z/OS does the DECFLOAT exists in DB2 v8.1?
    When I take the DDL from the z/OS the column is marked as FLOAT. Does it make sense to have inifnity values stored in it (or the DDL is wrong)?

    Thanks for your help

    Last edited by altura; 10-07-10 at 05:27.

  4. #4
    Join Date
    Jan 2003
    Ok I found the problem:

    The "Infinity" value was observed in DBVisualizer when connecting to my Z/OS DB2.
    This was confusing because the "Infinity" value is not implemented with FLOAT datatypes in DB2 (implemented only with DECFLOAT).

    Casting the column to FLOAT shows me the real value behing "Infinity" that was in fact 1EXP75.

    This leads me in several issues during migrating Z/OS tables to Linux:

    Exporting the table DDLs from Z/OS declaring FLOAT(4) columns and executing those DDLs into DB2 Linux makes some silent conversions:
    The FLOAT(4) is a single precision floating point, on Z/OS the max limit value is near 1EXP75.
    The FLOAT(4) is converted into REAL in DB2 linux, the max limit is near 1EXP38 (!! smaller!!).

    Importing data to DB2 Linux failed in error because of incompatible column length between the export (FLOAT(4) with limit 1EXP75) and the target table (REAL with limit 1EXP38).

    To fix this problem, I must change the FLOAT(4) into FLOAT(25) in the DB2 linux tables in order to force double precision floating point (limit max 1EXP308 in linux).

    No more infinity issue.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts