reject LINK

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
nag0143
Premium Member
Premium Member
Posts: 159
Joined: Fri Nov 14, 2003 1:05 am

reject LINK

Post by nag0143 »

hey all i got a question??
what is the difference between reject LINK & reject constraint
what is the best way to use them........

:?:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A reject link does not have a constraint expression. Instead, it handles any row that has not been processed by any earlier-executed output link. For example, if your Transformer stage has four output links, then you would have constraint expressions on the first three (in defined execution order), and the fourth could be a "rejects" link.
A reject link, if it handles any rows, will cause a "rejects" event to be logged in the job log.

The term "reject constraint" does not really apply in server jobs. If, in the same example, instead of making the fourth output link a reject link you used a constraint expression that encompassed all other possibilities (the logical inverse of the union of the previous three output constraint expressions), then this link would serve to capture the "rejected" rows, but would not log a "rejects" event in the job log.

There is one other use for a rejects link, and that is to identify rows that are rejected by ODBC drivers or database servers. In the Transformer stage that drives the output link to the database, create a rejects link. This rejects link will capture any row that was not successfully sent to the database. You can add diagnostic information on the rejects link by capturing the values from link variables SQLSTATE, DBMSCODE and LASTERR from the link that drives the database. (SQLSTATE is primarily for ODBC and UV connections.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Vipin
Participant
Posts: 15
Joined: Thu Oct 16, 2003 4:05 am
Location: India

Post by Vipin »

How to define a link as a reject link.....??
I mean how datastage will understand that a link is a reject link..!!

I know how to do this using a constraint , how to use Reject link ?
Would you mind sharing it with me...??

Regards,
Manoj
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

When you open the constraints window, there is a four column grid into which you can load your constraint expressions (the second column). The third column of this grid contains a check box that allows you to identify this particular link as a reject link. If you do this, when you return to the Transformer stage from which you opened it, the constraint expressions shows as "[Reject]".
The fourth column in the constraints grid allows you to specify the maximum number of rows that can be processed along any particular link. If a link is handling erroneous rows (such as a reject link might be doing) it is quite useful, particularly in testing and development phases, to set this limit so that your job aborts if too many "bad" rows are processed (or if your output constraint expressions are incorrect in terms of your business logic!).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Vipin
Participant
Posts: 15
Joined: Thu Oct 16, 2003 4:05 am
Location: India

Post by Vipin »

Thanks Ray...!!
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post by Teej »

Ray --

This is what causes a lot of confusions with folks here using PX when I try to explain things to them.

So that is why I used the terms "Reject Link" and "Reject Constraint".

A "Reject Link" in my definition is the actual broken line link out the Transform stage to capture records that the Transform stage drops. This is not available for Server.

A "Reject Constraint" in my definition is a formalized "Reject" option checked in the Constraint box. This is the "Else" choice for the Constraint variables. The link out that is a solid line.

In PX, records DO get dropped for reasons I do not fully understand. In order to get those records, you have to see what goes out the Reject Link.

Do you have a better way to define those two distinct behaviors?

-T.J.
Developer of DataStage Parallel Engine (Orchestrate).
sri1dhar
Charter Member
Charter Member
Posts: 54
Joined: Mon Nov 03, 2003 3:57 pm

ORA error code in parallel job

Post by sri1dhar »

I thought about starting a new link but this thread seemed to be relevant for my problem:

I am designing a parallel job (Parallel Extender) and using ORACLE stage.
If there is a reject becuase of constraints violation I need to capture the ORACLE error code
and message and log into a table.

I was able to do this earlier in a server job (ORA OCI9 stage) by using LinkVariable -> DBMSCODE and using the
following derivation in a transformer stage:
Field(DSGetLogEntry(DSJ.ME,DSGetNewestLogId (DSJ.ME,DSJ.LOGANY)-1) ,":",4,5)

In parallel job oracle stage I set the output reject record = TRUE to capture reject rows. But this is only data
and I can't capture the error code.
I couldn't locate the equivalent of DBMSCODE in Parallel Extender - Oracle Stage.
Also the log generated by a parallel job is lot different from server job. This job doesn't have the ORA error.

Is there a way I can captre ORA error code & message.

I appreciate any help.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Teej wrote:Ray --

This is what causes a lot of confusions with folks here using PX when I try to explain things to them.

So that is why I used the terms "Reject Link" and "Reject Constraint".

A "Reject Link" in my definition is the actual broken line link out the Transform stage to capture records that the Transform stage drops. This is not available for Server.

A "Reject Constraint" in my definition is a formalized "Reject" option checked in the Constraint box. This is the "Else" choice for the Constraint variables. The link out that is a solid line.

In PX, records DO get dropped for reasons I do not fully understand. In order to get those records, you have to see what goes out the Reject Link.

Do you have a better way to define those two distinct behaviors?

-T.J.
I think we do need a new thread for this. The OP specified server, so that's what I answered. I can see what you're saying for PX, but will give considered thought to it before answering.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply