Double to decimal conversion using modify stage

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
monishagj
Participant
Posts: 2
Joined: Wed Jul 10, 2013 1:57 am

Double to decimal conversion using modify stage

Post by monishagj »

Hi,

I have data coming in Decimal format like 98789.99. After reading this, i need to sum up all these values in Aggregator stage.
For that i tried modify stage to convert dfloat to decimal. i got the error as below

Modify_171: When checking operator: When binding output schema variable "outRec": When binding output interface field "TRL_Tot_Amt_In" to field "TRL_Tot_Amt_In": Conversion from source type "dfloat" to result type "decimal[17,2]": Possible range limitation.


I used like this :

TRL_Tot_Amt_In:decimal[17,2]=decimal_from_dfloat (TRL_Tot_Amt_In)
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: Double to decimal conversion using modify stage

Post by SURA »

It is not an error. It is a warning in which you need to give attention.

In relates to conversion do the search in the forum. You can find good number of threads will help you to find the solution.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DataStage is alerting you to the fact that some dfloat values can not be stored in a decimal[17,2] column (because they are too large). You can choose to ignore/demote/suppress this warning only if you are 100% certain that every value you will be processing is legal for decimal[17,2].
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
monishagj
Participant
Posts: 2
Joined: Wed Jul 10, 2013 1:57 am

Post by monishagj »

thank u,
I cleared that warning by Right click on the director warning--> Add rule to Message handler and give a name
DSUser2000
Participant
Posts: 42
Joined: Tue Oct 20, 2009 8:36 am

Post by DSUser2000 »

You can also tell your Aggregator to directly output decimal values by adding the "Decimal Output" property under the "Sum Output Column"! This would be the preferred solution in my eyes. Otherwise, I would do such conversions just in a transformer and not a modify stage.
Post Reply