Page 1 of 2

Best/easiest way to capture reject records in datastage

Posted: Fri May 23, 2008 5:30 pm
by yuva010
Hi,
In our project we want to implment reject handling.
Suppose there are 100 records at source & only 95 records moved to target. How can I capture those 5 records? The reason behind rejection might be anything.
Along with that, can I generate reason message for each record?

transformer

Posted: Fri May 23, 2008 8:34 pm
by jtsoong
if they are being rejected from a Transformer stage you can click on the 'constraints' button (top left) and set up a reject link

Posted: Fri May 23, 2008 11:17 pm
by yuva010
Thanks for answering, few more questions -
Does it capture whole source row or only some referrence?
Does it capable of giving the reason of rejection?

Posted: Sat May 24, 2008 3:56 am
by ArndW
Even though you posted in "General" you marked it as a PX question. Reject links in PX come off the output stage and reflect the input data as well as SQL or other errors where applicable.

Posted: Sat May 24, 2008 5:51 am
by yuva010
Yeah, from next time onwards I'll post questions in PX.

So does it mean, if I want to implement Error Handling (reject records) at each process (Extract, Transform & Load), it is not possible.
I can handle only during load?

Posted: Sat May 24, 2008 6:13 am
by ArndW
Handling of rejects is possible at any point in time in DataStage. You need to know what type of rejects you are looking for - the first response was assuming you had output to a database or output link which failed, other type of rejects such as bad column values are usually handled within the job itself.

Posted: Sat May 31, 2008 5:40 am
by ag_ram
jtsoong wrote:if they are being rejected from a Transformer stage you can click on the 'constraints' button (top left) and set up a reject link
The constraints to a particular link will NOT result setting up a Reject Link to a Trasformer Stage.

You might come to say that clicking on the Otherwise/Log in the Constraint of the particular Link and keeping that link at last in the Link Order could catch the (rejected) records which failed to meet constraints on all the previous output links.

For your information:

The conversion of Stream Output Link to Reject Link in a Transformer Stage will happen only when applying "Convert to Reject" action on the Stream Output Link.

Author(yuva010),

Give some extra care when using Otherwise/Log option in the Transformer Stage. Better refer Parallel Job Defveloper's Guide page# 449.

Posted: Sat May 31, 2008 5:50 am
by ag_ram
yuva010 wrote:Thanks for answering, few more questions -
Does it capture whole source row or only some referrence?
Does it capable of giving the reason of rejection?
1. Reject from only Source(if it is in Transformer Stage)

2. No. Reason for rejection should be user-described.

Posted: Mon Jun 02, 2008 12:51 am
by yuva010
In 'Px', except transformer stage which are the
other stages where we can use reject link?
Merge, Lookup etc..?

Posted: Mon Jun 02, 2008 1:03 am
by ray.wurlod
Many parallel stage types support a reject link. The descriptions of each in the manuals will tell you which they are.

Posted: Mon Jun 02, 2008 1:10 am
by tsn
1. what type os rejection it is?

is that due to the data comes in source

or

while performing the validation rule in your requirement.

If data you are getting in the source not matches with the job developed those general warnings and errors you can get it in the reject link.

whereas if your requirement expects '1' and 'A' is coming in that if you want to reject the record then you need pull out those records and store it.

you should store the rejected, it won't come automatically

Posted: Mon Jun 02, 2008 1:16 am
by yuva010
Ohhh Yeah.... Thats' true...
But I am expecting such a rejection will also get captured automatically as long as I have mentioned correct data types for target.

Posted: Mon Jun 02, 2008 1:21 am
by ray.wurlod
Not at all. AGE might be an integer, but - for a person - you'd expect to reject negative values and "too large" values (over 120, say).

Posted: Mon Jun 02, 2008 2:24 am
by tsn
It is based on your requirement. can you narrate what is your requirement. so that it wil be useful for the boarders to write the correct answers / solutions to your queries.

Posted: Mon Jun 02, 2008 2:26 am
by tsn
It is based on your requirement. can you narrate what is your requirement. so that it wil be useful for the boarders to write the correct answers / solutions to your queries.