Data conversion

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
parameswar
Premium Member
Premium Member
Posts: 66
Joined: Sun Apr 08, 2007 12:34 pm

Data conversion

Post by parameswar »

Hi,

I have source data in float type and values are coming in the format 1.01177e+12. I need to convert to decemal type with proper value.

Please suggest what to do. Is there any inbuild function/ routines to convert it? I tried dfloattodecimal(), but it is not working.

Thanks,
Parameswar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This IS a proper value. Due to the size of the number the data browser has been programmed to display it in "scientific notation".
1.01177e+12 means 1.01177 * 10**12, or (approximately) 1011770000000
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Mhasan
Participant
Posts: 38
Joined: Wed Apr 19, 2006 10:03 pm
Location: Bangalore

Post by Mhasan »

ray.wurlod wrote:This IS a proper value. Due to the size of the number the data browser has been programmed to display it in "scientific notation".
1.01177e+12 means 1.01177 * 10**12, or (approximately) 1011770000000

Thanks Mr. Ray. Above is my input in Float and output datatype is decimal.. Above calculation u done same i need to do in transformer ?
i did the below logic
DFloatToDecimal(inputcolumn.SEQUENCE[0,5] * pwr(10,12))
it is not working :-(

If i do this
DFloatToDecimal(inputcolumn.SEQUENCE[0,5]) I get 0000000000000. as output what is the correct solution please suggest
Mhasan
Participant
Posts: 38
Joined: Wed Apr 19, 2006 10:03 pm
Location: Bangalore

Post by Mhasan »

ray.wurlod wrote:This IS a proper value. Due to the size of the number the data browser has been programmed to display it in "scientific notation".
1.01177e+12 means 1.01177 * 10**12, or (approximately) 1011770000000

Thanks Mr. Ray. Above is my input in Float and output datatype is decimal.. Above calculation u done same i need to do in transformer ?
i did the below logic
DFloatToDecimal(inputcolumn.SEQUENCE[0,5] * pwr(10,12))
it is not working :-(

If i do this
DFloatToDecimal(inputcolumn.SEQUENCE[0,5]) I get 0000000000000. as output what is the correct solution please suggest
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Just do nothing. Let the float number travel through your job. The scientific notation display is merely an artifact of the data browser. If you need to convert this to decimal, make sure that the decimal data type has a precision of at least 18 (six digits in your number and twelve in the exponent) and a scale of however may you need, for example 5. So, for example, try decimal[20,5] as the target data type.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Mhasan
Participant
Posts: 38
Joined: Wed Apr 19, 2006 10:03 pm
Location: Bangalore

Post by Mhasan »

Thanks

Ray you didnt complee the sentence ,
you need to convert this to decimal, make sure that the ...
what need to be make SURE.... please let me know the exact solutions...
Thanks
M A hasan
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Post by kwwilliams »

He finished his sentence, you just need to make a small donation in order to view it! :lol:
Post Reply