If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to store infinity in FLOAT DB2 UDB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-06-10, 12:23
altura altura is offline
Registered User
 
Join Date: Jan 2003
Posts: 21
How to store infinity in FLOAT DB2 UDB

Hi,

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.

Vincent

Last edited by altura; 10-07-10 at 04:27.
Reply With Quote
  #2 (permalink)  
Old 10-06-10, 22:56
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
You can use the new DECFLOAT data type, which I think supports infinity values.
Reply With Quote
  #3 (permalink)  
Old 10-07-10, 03:26
altura altura is offline
Registered User
 
Join Date: Jan 2003
Posts: 21
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

Vincent

Last edited by altura; 10-07-10 at 04:27.
Reply With Quote
  #4 (permalink)  
Old 10-07-10, 09:57
altura altura is offline
Registered User
 
Join Date: Jan 2003
Posts: 21
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.

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On