Incorrect Data format when reading from a double datatype

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
highpoint
Premium Member
Premium Member
Posts: 123
Joined: Sat Jun 19, 2010 12:01 am
Location: Chicago

Incorrect Data format when reading from a double datatype

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First suggestion would be an exact search here for "scientific notation".
-craig

"You can never have too many knives" -- Logan Nine Fingers
highpoint
Premium Member
Premium Member
Posts: 123
Joined: Sat Jun 19, 2010 12:01 am
Location: Chicago

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

These representations ARE decimal.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
highpoint
Premium Member
Premium Member
Posts: 123
Joined: Sat Jun 19, 2010 12:01 am
Location: Chicago

Post by highpoint »

I like then without the scientific notations.

Like this format 100 or 0.78558

Not with 10000E+2

Appreciate help.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

"CAST " it.
DJRH
Premium Member
Premium Member
Posts: 23
Joined: Fri Jul 07, 2006 9:03 am
Location: Mississauga

Post 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.
DJRH
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's not difficult, it's merely tedious.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply