Page 1 of 1

LookUp Stage with just REJECT link

Posted: Tue Aug 29, 2017 8:43 am
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.

Posted: Tue Aug 29, 2017 10:38 am
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.

Posted: Wed Aug 30, 2017 7:12 am
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.

Posted: Thu Sep 07, 2017 4:37 pm
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.