Getting negative value of decimal field

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
swathi Singamareddygari
Participant
Posts: 48
Joined: Fri Feb 29, 2008 1:09 am
Location: Bangalore

Getting negative value of decimal field

Post by swathi Singamareddygari »

Hi,

I want to get a negative value of a decimal field.

MY input is 1112223334567822.22
I want output as - 1112223334567822.22

For this i gave output as -1*input

but i am getting output as -1112223334567822.24 instead of -1112223334567822.22

When i am using NEG function i am facing same problem


Please help me

Thanks for ur help

Regards

Swathi S
Thanks&Regards
S.Swathi
kishore2456
Participant
Posts: 47
Joined: Mon May 07, 2007 10:35 pm

Post by kishore2456 »

Try Abs(input)
If it doesnt work, try this

if input > 0 then input * -1 else input
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 input field and of the output field? Search DSXchange for discussion of how/why floating point numbers can not be stored to full accuracy in computers.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply