LookUp Stage with just REJECT link

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
sensiva
Premium Member
Premium Member
Posts: 21
Joined: Tue Aug 22, 2017 10:39 am

LookUp Stage with just REJECT link

Post by sensiva »

Hi,

I am still on the learning phase in datastage and I have a doubt with datastage lookup stage.

I want to capture only the reject rows and I don't want to do anything with the correct matching rows.

I have a parallel job with a lookup stage that has input from a oracle connector and a reference also from oracle connector reading reords from different tables and comparing multiple keys. I made the constraint to Reject for lookup failure. I dragged the reject link to a transformer to process the records, but it gives a compilation error (Error : An unidentified error has occured) no other info.

If i connect both the output and the reject link, the flow compiles without error. But i dont need the matching records.

Is it normal that lookup does not support only the reject link ? May be in that case, is it better i write the sql query in the oracle conncetor instead of doing that using lookup.
sen
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

Please see response below preceded by "=>".

Is it normal that lookup does not support only the reject link ?
=> Yes.

May be in that case, is it better i write the sql query in the oracle conncetor instead of doing that using lookup.
=> You can send the "matched" output records to a 'Sequential File' stage mapped to /dev/null.
UCDI
Premium Member
Premium Member
Posts: 383
Joined: Mon Mar 21, 2016 2:00 pm

Post by UCDI »

if you pass everything through the lookup and back out, it will stamp rejected records with a null/0/empty string/etc type output for the failed lookups, and a simple constraint after can split out what you want.

you can also do a reject and success link path, and drop the success link path (put it to a peek or something) and keep the reject path flowing.

whether an SQL statement is better or possible depends on your data and setup but it may be best if you can filter it so that only lookup rejects are extracted, saving extracting, passing, and looking up records you never even wanted. It is usually best to only extract what you need, whenever possible, for most applications.
cdp
Premium Member
Premium Member
Posts: 113
Joined: Tue Dec 15, 2009 9:28 pm
Location: New Zealand

Post by cdp »

You indeed need an output link with the Lookup Stage.

But what I would do if I only cared about the Rejected data:

After the output link of the Lookup Stage, just add a Copy Stage and nothing else.
It should give you the result you're after.
Post Reply