NVL in Server jobs?

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
dsdoubt
Participant
Posts: 106
Joined: Sat Jul 15, 2006 12:17 am

NVL in Server jobs?

Post by dsdoubt »

Hi,

Is there any functions available like NVL(input,'x'). ie., to return first non null value. Similar to NullToValue() in PX. Or If..Then...Else is the only case?
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

You have a NullToEmpty and NullToZero.
You can extend that to get what you want.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You'll find these as Transforms, rather than as Routines. Create your own NullToValue transform in the same category. Of course, it will need two arguments, not one.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Expanding on Ray's answer. Create a new transform 'NullToValue' with two input arguments, Arg1 and Arg2, where Arg1 is your input and Arg2 is the value if input is NULL. Put this code in the "Definition" field.

Code: Select all

(IF ISNULL(%Arg1%) THEN %Arg2% ELSE %Arg1%)
Whale.[/i]
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You can also incorporate Len(in.Col) < 1 in Whale's code to handle source files.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply