Look up and SCD

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
Munish
Participant
Posts: 89
Joined: Sun Nov 19, 2006 10:34 pm

Look up and SCD

Post by Munish »

Hi Everybody,
In one of my Load job (to Oracle)
I need to do lookup to find the key (from dimension table)
and load the target table with the key values
ie I am getting Account_Num as input and I need Account_Key for output.

Now if Account_Num does not exist, I do not want to reject my rows but continue the job with Default value for key.
ie
If Account_Num does not have respective Account_Key in the DB, I want to send -1 as Account_Key which stands for unkown in our DB.

I am using Lookup stage and Lookfilesets.

Please advice how this scenario should be handled.

Thanks,
Munish
MK
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Perform the lookup, if there is a hit, send it down one link, if it does not, send it down the other. Merge the both before doing upsert or send both the links directly to the same database.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Munish
Participant
Posts: 89
Joined: Sun Nov 19, 2006 10:34 pm

Post by Munish »

Thanks for the advice.
I am doing like this only.
I am just wondering that is there any property where I could put this defalut value and do not have to split and merge data.

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

Post by ray.wurlod »

Make the "lookup failed" rule in your Lookup stage "Continue", and the fields derived from the reference input link Nullable. Downstream add a Modify or Transformer stage to handle the null, replacing it with -1.

You are still thinking like a server job developer. In parallel jobs the rule (mainly) is "one task, one stage". Or "one stage, one task". You can not substitute the in-band null within the Lookup stage. You need an extra stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply