Conversion factors inserted as double are read and converted

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
tminelgin
Premium Member
Premium Member
Posts: 13
Joined: Tue Oct 19, 2010 12:09 pm

Conversion factors inserted as double are read and converted

Post by tminelgin »

I have a process that reads a flat file of UOM data to insert into a table for subsequent processing. The column in the table is defined as DECFLOAT and I insert it as DOUBLE with no issues. Querying the rows in my SQL tool shows all values the same however when I read the table with Datastage some of the values are converted to scientific format, ie exponential. Is there a setting or cast function that will leave these values as is?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

What datatype are you using in DataStage?

(This is a trick question, since "float" or "dfloat" use a binary representation and only convert to display format when you display the value - which would be the point in time when a conversion to an exponential format would occur).
tminelgin
Premium Member
Premium Member
Posts: 13
Joined: Tue Oct 19, 2010 12:09 pm

Post by tminelgin »

Using DOUBLE as type. It is not only the viewer, when I write these values to a file they are converted.
T. M.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First thing I'd suggest is an exact search here for "scientific", the topic of inadvertent scientific notation has come up several times and I got 40 matches when I just did the same.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The file is also a "viewer", since the data is being written a text, so a conversion has taken place. You need to specify a column output format to override the default. I like "%f" (see the documentation for sprintf() for an explanation)

Image
Post Reply