Exception Handling

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
senthilmp
Participant
Posts: 85
Joined: Mon Sep 22, 2008 6:11 am

Exception Handling

Post by senthilmp »

Hi,

I am trying to design a job such that if an exception occurs it should write to a file or table

i.e Out of 4 rows from source 2 rows have Varchar2(15) and other 2 rows have Varchar2(12), and the target has a structure of Varchar2(12).
When job runs it throws the warning saying inserted value too large. Now i want the other two rows to be inserted into table and the bad record (ie of length varchar2(15)) should be written to a file or table.

To be simple i have to do an Exception Handling like in Stored Procedure
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Setup a 'reject link'. Open the online Help and on the Index tab type 'reject rows' for a lengthy discussion on the topic.
-craig

"You can never have too many knives" -- Logan Nine Fingers
csri
Participant
Posts: 99
Joined: Wed Jul 11, 2007 8:02 am

Post by csri »

Setup a new link from the transformaer and set it as 'Reject row'.
To catch rows which have failed to be written to an output link, set the Constraint field to OutputLink.REJECTEDCODE

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

Post by ray.wurlod »

You can test the mapping with an Oconv() function. Create a routine that applies the Iconv() function to its argument with "NLSmapname" as the second parameter to Oconv() then test whether the conversion was successful using the Status() function.

Obviously you need to replace "mapname" in the above with the name of an actual NLS map.
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