Lookup stage handling conditions on each reference links

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
kumarjit
Participant
Posts: 99
Joined: Fri Oct 12, 2012 7:47 am
Location: Kolkata

Lookup stage handling conditions on each reference links

Post by kumarjit »

I'm employing a lookup stage to refer my main source with TWO reference links , one of which would be set to return multiple rows
if the lookup is successful.


Following are the schema of Stream link, and the Reference links
MEMBER(stream) will have fields MEMBER_ID, FIRST_NAME, LAST_NAME , DOB
ADDRESS(Ref1) will have fields MEMBER_ID , ADDRESS, ADDRESS_TYPE
DATE_DATA(Ref2) will have fields LL_DATE , UL_DATE


MEMBER is looked up against ADDRESS using MEMBER_ID as the key column , and for a single MEMBER_ID there can be more than one address.
MEMBER is range looked up against DATE_DATA where DOB must lie between LL_DATE and UL_DATE (DATE_DATA consists of only a single record)


In the Lookup Stage conditions window I have entered the following settings:


For Ref1
Condition:MEMBER_ID="M1" OR MEMBER_ID="M2" OR MEMBER_ID="M3"
Action if condition not met: Continue
Action on lookup failure: Continue


For Ref2
Action if condition not met: Continue
Action on lookup failure: Continue

Of the 41 input records ,the output retrieves Three records pertianing to the three member ID's specified in the Ref1 condition , but
if I specify CONTINUE for both Condition failure and lookup failure, shouldn't there be 41X2=82 records in the output , because all the 41
records are CONTINUEd from the two reference links , irrespective of whether the condition or lookup criteria matches or not .


How does the lookup stage handle conditions specified against each of the reference links tagged to the lookup ?


Please help.


Regards
Kumarjit.
Pain is the best teacher, but very few attend his class..
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I'm not sure where your 41 input records should equate to 82 output ones.

The logic is that first the condition is evaluated and only if that is "true" does a lookup occur, which may return multiple records in your case.

It would be simpler for you to initially use 2 distinct lookup stages in order to get the logic worked out, and then you can later combine the lookup stages together if that still makes sense.
Post Reply