DataStage Equivalent of the SIGN Function in Oracle

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
Shaanpriya
Participant
Posts: 22
Joined: Thu Sep 11, 2008 11:47 pm
Location: Bangalore

DataStage Equivalent of the SIGN Function in Oracle

Post by Shaanpriya »

Hi all,
I have this requirement in my project wherein I am supposed to use the SIGN function in order to find if the augument (Number) is positive , negative or zero. Does anyone know what function I can use in Parallel jobs to attain the same funtionality.

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

Post by ray.wurlod »

Welcome aboard. Try what Oracle does under the covers.

Code: Select all

If InLink.TheNumber = 0 Then 0 Else InLink.TheNumber / Abs(InLink.TheNumber)
or, if you prefer, try this.

Code: Select all

If InLink.TheNumber = 0 Then 0 Else If InLink.TheNumber > 0 Then 1 Else -1
I'm surprised you could not work that out for yourself.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Shaanpriya
Participant
Posts: 22
Joined: Thu Sep 11, 2008 11:47 pm
Location: Bangalore

Post by Shaanpriya »

Wow... Thanks Ray for taking the time to reply for the query..
Post Reply