IsNULL function in Lookup Columns

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
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

IsNULL function in Lookup Columns

Post by satheesh_color »

Hi All,

I have a problem with the below constraint in one of my jobs

IsNULL(Lkp.Column1) AND IsNULL(Lkp.Column2)

both Column1 and Column2 in the hashed file are key fields.How to validate the above constraint. I have checked my hashed file,none of the columns are null.Please let me know your thoughts on this issue.



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

Post by chulett »

What are you trying to accomplish with this constraint? If it is simply to check the success/failure of the lookup, that should work but the 'more proper' solution would be the NOTFOUND link variable.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What is the problem that you are having?

The expression is syntactically correct. The key columns will not be null unless the lookup fails (a lookup is functionally a left outer join).
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 »

Hmmm... ok. Care to post your resolution? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

Post by satheesh_color »

Thanks for your comments.

The key columns in the hashed files should not be null. So i am confused with IsNull instead of NOTFOUND link variable.


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

Post by chulett »

So we're not resolved? You are correct that you populate the key columns with non-null data from the input stream so they "should not be null". However, when the lookup fails all columns return null (including the keys) so they can be checked for null post-lookup to determine failure.

The NOTFOUND Link Variable replaces that technique with a status you can check directly.
-craig

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