Integer division by integer problem

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
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Integer division by integer problem

Post by somu_june »

Hi,

I'm trying to divide two integer numbers num1 and num2 in transformer and their values are 285363/362089 and the result is 0.78810 and I'm trying to write this to a output field out1 decimal(5,2) but I'm getting a value of 000.00 instead of 000.78.


I searched the form on how/why floating point numbers can not be stored to full accuracy in computers. But no luck.


Can some body tell me how to get the actual decimal value instead of 0 value.



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

Post by ray.wurlod »

What happens if you convert each to Decimal first? Use DecimalToDecimal() function.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Thanks Ray it is working now after I changed it to decimal as you said
somaraju
Post Reply