Page 1 of 1

Incorrect Data format when reading from a double datatype

Posted: Tue Jun 07, 2011 8:45 am
by highpoint
Hi,

I am reading from db2 table having column datatype of type double 8.

When i import table definitions the DataStage takes this as double 53.

When i query the table for the column i see values like

100
6.94391376623802
0.638014075806097


But when i see extracted data in a sequential file in unix i see data for

100 like this 1.00000000000000000E+02
0 like this 0.00000000000000000E+00


Help is appreciated how i get this as 100 and 0 as i see it in database.

Posted: Tue Jun 07, 2011 9:52 am
by chulett
First suggestion would be an exact search here for "scientific notation".

Posted: Tue Jun 07, 2011 1:27 pm
by highpoint
Did search but could not find anything suitable for my needs.

I am thinking the only way i can do is to convert to a decimal.

I would like to know which function can be used. And what should be the length and precision of decimal in order not to truncate any data.

Appreciate help on this.

Posted: Tue Jun 07, 2011 2:52 pm
by ray.wurlod
These representations ARE decimal.

Posted: Tue Jun 07, 2011 3:20 pm
by highpoint
I like then without the scientific notations.

Like this format 100 or 0.78558

Not with 10000E+2

Appreciate help.

Posted: Tue Jun 07, 2011 9:13 pm
by SURA
"CAST " it.

Posted: Wed Jun 08, 2011 11:27 am
by DJRH
I have a similar issue..can somebidy tell me if we can use a environment variable or some configuration setting , where we can fix this double column and the data read is corrrected.

Its not easy to cast every column in a job as we have lot of jobs in the project.

Posted: Wed Jun 08, 2011 4:40 pm
by ray.wurlod
It's not difficult, it's merely tedious.