Converting decimals

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
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Converting decimals

Post by mydsworld »

I want to convert a decimal field from Length,Precision 8,4 to 11,9.

DecimalToDecimal function converts the source field to target with all zeroes.

Please advise.
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Converting decimals

Post by sud »

How about just a change in the scale and precision ... since it is a change from smaller scale and precision to bigger the default conversion should be just fine. Have you tried that?
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

I tried that since it is length,precision (8,4) to (11,9), am getting target values like this :

??.000000000

which on trying to insert into a table fails.

So, then I tried something like DecimalToDecimal(<Input Decimal Field>)

Then I am getting all values in zero like

00.000000000
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Post by sud »

If the data is finally landing into the database, just leave the datatype as the original one. Another approach could be, change the precision and scale in the source itself.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
Post Reply