Page 1 of 1

Capturing rejected records

Posted: Wed Feb 06, 2008 4:56 am
by dsuser08
Hi

Is it possible to capture rejected records using join component.I will be performing Fullouter,left outer,right outer and inner join.I need to capture rejeted records in sequential file.

Can I use merge stage for the above.In Merge ,We have Reject mode:output.It says pass rejected records down reject link.

does it mean
Input Processing Output
sequentialFile1 Merge sequentialFile3(Matched records)
sequentialFile2 sequentialFile4(UnMatched records)
or

Input Processing Output
sequentialFile1 Merge sequentialFile3(Matched records)
sequentialFile2
From sequentialFile3(Matched records) ,I have to give a link to sequentialFile4 which will capture UnMatched records
Thanks

Posted: Wed Feb 06, 2008 5:02 am
by ray.wurlod
Welcome aboard. Just as in SQL there is no such thing as a rejected record when a join is performed. A row is output from the join if the join criteria are satisfied. Nothing else happens.
This is why the Join stage does not have support for a Reject output link.

Posted: Wed Feb 06, 2008 5:04 am
by Maveric
Join does not support reject link. Use a lookup stage if the reference data volume is low or merge stage.

Posted: Wed Feb 06, 2008 5:18 am
by dsuser08
Thanks so much for your reply.In Merge ,We have Reject mode:output.It says pass rejected records down reject link.

does it mean
Input Processing Output
sequentialFile1 Merge sequentialFile3(Matched records)
sequentialFile2 sequentialFile4(UnMatched records)
or

Input Processing Output
sequentialFile1 Merge sequentialFile3(Matched records)
sequentialFile2
From sequentialFile3(Matched records) ,I have to give a link to sequentialFile4 which will capture UnMatched records

Please explain

Re: Capturing rejected records

Posted: Wed Feb 06, 2008 7:15 am
by gnreddy
Hi,

The best way to capture rejected data is LookUp Stage.
U can send matched records to one table and rejected records to one table.

Regards,

Posted: Wed Feb 06, 2008 3:00 pm
by dspxlearn
gnreddy,

What if you want ONLY the rejected records(unmatched) records from the lookup stage and the matched records are not be be captured anywhere?
[/code]

Posted: Wed Feb 06, 2008 3:02 pm
by dspxlearn
gnreddy,

What if you want ONLY the rejected records(unmatched) records from the lookup stage and the matched records are not be be captured anywhere?
[/code]

Posted: Wed Feb 06, 2008 3:28 pm
by ray.wurlod
dspxlearn wrote:What if you want ONLY the rejected records(unmatched) records from the lookup stage and the matched records are not be be captured anywhere?
Send the matched records into a Copy stage with no output link. It will eat them happily.

Posted: Wed Feb 06, 2008 3:32 pm
by snt_ds
Thanks ray,

I did the same when i was working on this kind of stuff yesterday. But just wanted to confirm :D . Can we use an external target stage and direct the output to the Unix blackhole (>> Null)?

Posted: Wed Feb 06, 2008 3:38 pm
by ray.wurlod
Yes, but the UNIX "black hole" is /dev/null, not NULL.

In Windows it's .\NUL (there is one in every folder). Hmm, maybe that tells us something about the O/S!

I still prefer the Copy stage. Add an annotation and/or a description in the Copy stage to alert the next developer to what you intend by having no output link.

Posted: Wed Feb 06, 2008 3:53 pm
by dspxlearn
Thanks Ray!!
This post for really informative. :D
Dsuser,
Time to mark it as Resolved if you are allset.

Posted: Thu Feb 07, 2008 3:52 am
by dsuser08
If I have to use Full-outer or Right outer or Left outer and capture rejected records,Which component should I use.Please help.

Posted: Thu Feb 07, 2008 6:07 am
by ag_ram
There is no rejected records in Join. You can't get the matched and unmatched records in two separate links using join stage. Instead You can capture the nonmatching records from JOIN by using a transformer satge or a filter stage after the join stage:
Full Outer Join: Give a condition on the transformer or filter stage to filter out the records which is having NULL on the key column from left record or right record
Right Outer Join: Give a condition in the transformer or filter stage to filter out the left records having NULL.
and vice versa for Left Outer join

Posted: Thu Feb 07, 2008 1:53 pm
by ray.wurlod
dsuser08 wrote:If I have to use Full-outer or Right outer or Left outer and capture rejected records,Which component should I use.Please help.
What do you mean by "rejected"? If you do a join in SQL, where are the rejected rows? DataStage is no different.