Zero or Positive

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
dsquest
Participant
Posts: 6
Joined: Wed Mar 27, 2013 1:24 pm

Zero or Positive

Post by dsquest »

There should be some simple method or direct function available for sure, which Iam not able to find it readily. I can always go with If-Then-Else. But wanted to check, for other optimized options.

If there is any negative number, I expect 0.
Any positive can be send to the output directly.

Eg:

-2 --> 0
3 --> 3
0 --> 0

Thanks!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If-Then-Else.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nikhil_bhasin
Participant
Posts: 50
Joined: Tue Jan 19, 2010 4:14 am

Post by nikhil_bhasin »

You can refer to Parallel Job Developers Guide documentation - Appendix B - Transform functions for searching the functions available in DS :), Its easy to search use Ctrl+F and then search...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There's a neat way of solving this with a server function:

Code: Select all

 Oconv(InLink.TheNumber,"R1,99999") + 0
but I'm not aware of an equivalent parallel function, so would recommend If..Then..Else for parallel jobs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Neither am I, hence my response.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply