Mathematical Function FABS return value

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
panchusrao2656
Charter Member
Charter Member
Posts: 64
Joined: Sat Sep 17, 2005 10:42 am

Mathematical Function FABS return value

Post by panchusrao2656 »

FABS(00000067767332.29 * 100) returning me 6776733228 when the target is BigInt, where as it is returning 6776733229 when target is decimal.

It is giving correct values for most of values but for the following values it is giving wrong values.

00000067767332.29
00000067117893.84
00000065365551.43
00000057435593.04

For ths following one , it is giving correct value.
000000234168268.89

I am using this function to capture the decimal part of the incoming value, by multiplying it with 100 and then applying FABS to get absolute value( if i apply the FABS before multiplying with 100, it is truncating the decimal part) and then devide the result with 100 and capture the reminder using Modulus function(Mod). It is behaving strange for some values and most of the time it is goiving correct values.

I modified the code to multiply with -100 when input is < 0 otherwise multiply with 100 to get the desired result by avoiding the FABS function.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What is the data type of the source column?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
panchusrao2656
Charter Member
Charter Member
Posts: 64
Joined: Sat Sep 17, 2005 10:42 am

Post by panchusrao2656 »

Source Metadata is Decimal 13,2 and i am trying to capture the decimal part of it.
Post Reply