lookup condition and constraints

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
kjaouhari
Participant
Posts: 325
Joined: Thu Mar 16, 2006 10:22 am

lookup condition and constraints

Post by kjaouhari »

Hello dsxians !

In first I wish you a happy new year 2007 !

I'm trying to do a lookup that work with 2 oracle tables:
the first is input and the second is the reference_date and I want all the input rows if the table reference_date is empty.

Then if the reference_date is not empty we use the lookup but if is empty we want to pass all rows.
And I don't want to use the reject link

Thanks in advance for your ideas !
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

If i understood your requirement then do this:
Get that reference date in a UserStatus. Check it in a stage variable. If its empty then NOT(lookup.NOTFOUND) else @TRUE. Specify stage variable name in the constraint.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do it all in SQL. Use a CASE with a nested SELECT COUNT(Key)... to determine whether the reference table is empty. Deliver the results to DataStage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Pavan_Yelugula
Premium Member
Premium Member
Posts: 133
Joined: Tue Nov 23, 2004 11:24 pm
Location: India

Post by Pavan_Yelugula »

you can do this with a combination of small basic code and a set of jobs...
Step 1: Rite a small basic code to identify if the reference data table has records in it or not.
Step 2 :create two jobs one with look up and one without lookup which is a straight load
Step 3 : In the basic code put a if loop and call the appropriate job based on what your step 1 returns :wink:

Thanks
Pavan
kjaouhari
Participant
Posts: 325
Joined: Thu Mar 16, 2006 10:22 am

Post by kjaouhari »

Thanks all !
Post Reply