Lookup Stage

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
irajasekharhexa
Premium Member
Premium Member
Posts: 82
Joined: Fri Jun 03, 2005 5:23 am
Location: Bangalore
Contact:

Lookup Stage

Post by irajasekharhexa »

Hi,

I have a requirement that needs to retrive the data from the source where the lookup is not matched.

Suppose if source have the 10 records and look up has the 3 matched records remaining 7 unmatched records should be taken forward to Output link.

What i am doing is i taken normal lookup and a reject link.

So watever the reject link is getting data is taking into the output link. Is any other way can we achieve this.

Some thing like if lookup not happened take the rows to next stage?


Regds
Rajasekhar
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Re: Lookup Stage

Post by meena »

Join / Merge stage.

I have a requirement that needs to retrive the data from the source where the lookup is not matched.

Suppose if source have the 10 records and look up has the 3 matched records remaining 7 unmatched records should be taken forward to Output link.

What i am doing is i taken normal lookup and a reject link.

So watever the reject link is getting data is taking into the output link. Is any other way can we achieve this.

Some thing like if lookup not happened take the rows to next stage?


Regds
Havoc
Participant
Posts: 110
Joined: Fri Nov 24, 2006 8:26 am

Post by Havoc »

Lookup Stage : Take key column from primary link and also take column from the reference link. The column derived from reference link will be a NULL (if nullability of that column is set to 'Yes' else the appropriate null default value will be set to that column (e.g. 0 for an Integer). Place a transformer in the output link following the Lookup stage and do appropriate null handling/etc and you can identify which record failed the lookup and you can propagate it further. Remember.. to keep the lookup in 'Continue' mode if you wish to achieve this.

Join Stage: You can use left outer join on the link which was the primary link (in case of Lookup stage) and do the rest as mentioned above.

Merge Stage: The output from Merge Stage in Keep mode can be erratic if you have duplicates coming in for your master link which you will need to interchange if you wish to achieve this..

Hope this helps ..
vijayrc
Participant
Posts: 197
Joined: Sun Apr 02, 2006 10:31 am
Location: NJ

Re: Lookup Stage

Post by vijayrc »

irajasekharhexa wrote:Hi,

I have a requirement that needs to retrive the data from the source where the lookup is not matched.

Suppose if source have the 10 records and look up has the 3 matched records remaining 7 unmatched records should be taken forward to Output link.

What i am doing is i taken normal lookup and a reject link.

So watever the reject link is getting data is taking into the output link. Is any other way can we achieve this.

Some thing like if lookup not happened take the rows to next stage?


Regds
In Lookup, you can either Fail/Reject/Continue if a specific condition is not met or if a matching row in reference file is not found. So I guess your option should say Continue if no match found.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The Merge stage consumes rows from its Update input(s) as they are touched. Therefore any remaining rows once the Master input has been exhausted will be those that were not touched.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
abhi989
Participant
Posts: 28
Joined: Mon Sep 19, 2005 2:31 pm

Post by abhi989 »

In your lookup stage properties - set condition not met = Fail and Lookup Failure = Reject. Take the reject link and process that.

Hope it helps
irajasekharhexa
Premium Member
Premium Member
Posts: 82
Joined: Fri Jun 03, 2005 5:23 am
Location: Bangalore
Contact:

Post by irajasekharhexa »

abhi989 wrote:In your lookup stage properties - set condition not met = Fail and Lookup Failure = Reject. Take the reject link and process that.

Hope it helps
I was done the Job which i used the logic was same as Abhi said. It's working fine.


Thanks all.

Regds
Rajasekhar
Post Reply