chopping 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
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

chopping decimals

Post by scorpion »

all,

i am getting values in my output file for one of my columns are like:

102.34
-103.68
108.98
-45.08
etc etc

but requirement is to get absolute values(to remove '-' symbol)

i used Abs function in my transformer for that perticular calculation,but when i tried with the function ,the decimals are chopped off.

i am getting values like..

102,
103.
108
etc etc.....

how to get absolute values without decimal values are chopped off.

thanks for the help.
Thanx&Regards
scorpion
Maveric
Participant
Posts: 388
Joined: Tue Mar 13, 2007 1:28 am

Post by Maveric »

You might want to investigate the function called Neg under Mathematical.
landaghaar
Participant
Posts: 38
Joined: Wed Sep 19, 2007 10:11 am
Location: Canada

Post by landaghaar »

in the worst case, put an If statement and if any number is < 0 then multiply it by -1 else take it as it is.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If you have fixed decimal to 2 places, do "ABS(In.Column*100)/100"
Post Reply