Double to Decimal 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
Raamc
Premium Member
Premium Member
Posts: 87
Joined: Mon Aug 20, 2007 9:08 am

Double to Decimal Conversion

Post by Raamc »

Hi,

I need to populate the Sum of all amount fields for an account into a sequential file.
In my job, i am reading the input file and passing the account number as key and calculating the sum of all amounts. The aggregator producing the sum of amounts in to a field of type DOUBLE.

If i drag this double field into sequential file, the record is not coming in a proper way. Exponents are visible in the file. Amount is coming like 1.222333E23.

Can any one suggest me how to convert this DOUBLE type data into DECIMAL. Is there any euivalent built-in function for this type conversion?

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

Post by ray.wurlod »

Be more precise about your Decimal data type - what precision and scale have you specified? What is the setting of the Decimal Output property in the Aggregator stage for the column(s) in question?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ntvidhya
Participant
Posts: 1
Joined: Mon Jan 28, 2008 12:21 am

Re: Double to Decimal Conversion

Post by ntvidhya »

Hi,

Use 'Decimal Output' from the properties & mention the scale & precision.

Eg: Decimal Output =(13,4)

Hope this solution answers your question.

[quote="Raamc"]Hi,

I need to populate the Sum of all amount fields for an account into a sequential file.
In my job, i am reading the input file and passing the account number as key and calculating the sum of all amounts. The aggregator producing the sum of amounts in to a field of type DOUBLE.

If i drag this double field into sequential file, the record is not coming in a proper way. Exponents are visible in the file. Amount is coming like 1.222333E23.

Can any one suggest me how to convert this DOUBLE type data into DECIMAL. Is there any euivalent built-in function for this type conversion?

Thanks in Advance[/quote]
Thanks, Vidhya
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Have you set the Decimal Output property of the Aggregator stage to the same precision and scale?
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