How can I set a default vale when a lookup fails?

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
tbtcust
Premium Member
Premium Member
Posts: 230
Joined: Tue Mar 04, 2008 9:07 am

How can I set a default vale when a lookup fails?

Post by tbtcust »

Hello all.

How can I set a default vale to a field when there is a lookup failure?

I using a Lookup Stage to find matches between master and reference data. The goal I to append a field to the master data file with data from a field from the reference data were there matches. When there is no match I need to append a "0".

How can this be done using a Lookup Stage? I have all but append code in place.

Thanks in advance for your help.
shaonli
Participant
Posts: 80
Joined: Tue Nov 28, 2006 6:52 am

Post by shaonli »

In the lookup use CONTINUE in lookup failure condition so that u pass record when there is mismatch also.Now next to lookup use transformer check whether the field extracted from reference link is null ornot.If it is null then put ) else the field of Ref link.

Thanks
shaonli
tbtcust
Premium Member
Premium Member
Posts: 230
Joined: Tue Mar 04, 2008 9:07 am

Post by tbtcust »

Thanks shaonli that works. I was tiring to solve in the wrong place.
Post Reply