How to redirect exception to rejects

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
idocrm
Participant
Posts: 17
Joined: Wed Jul 23, 2003 9:41 pm

How to redirect exception to rejects

Post by idocrm »

I am trying to insert some data into a table with PK defined.
The data contains dups, the insert of dups will result in ORA-00001.
How can I send the dups to reject file while continue insert the non-
dups?
Any help is appreciated.
idocrm
Participant
Posts: 17
Joined: Wed Jul 23, 2003 9:41 pm

Post by idocrm »

I'm more interested in finding an alternative besides reading/writing to the same Hashed file approach.
Thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You *should* be able to add another link to the transform that feeds the OCI stage and mark it as a Reject link. Any rows that cause the error will be redirected down the reject row where you can then do whatever you deem appropriate with them, including writing them to a reject file.

Unfortunately, this doesn't work in all versions of DataStage.

-craig
ariear
Participant
Posts: 237
Joined: Thu Dec 26, 2002 2:19 pm

Post by ariear »

As said before add a reject link and use as constraint Link Variables --> Outputs --> DBMSCODE .....
Works for 5.2
idocrm
Participant
Posts: 17
Joined: Wed Jul 23, 2003 9:41 pm

Post by idocrm »

I'm using 5.1. I've tried the reject link (test for DBMSCODE="ORA-00001") approach before I posted my question. Didn't seem to work.
Thanks for the help so far guys.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Try it without any constraints on the Reject link.
Post Reply