Page 1 of 1

abort job and capture rejcts

Posted: Sun Dec 06, 2009 8:31 am
by dodda
Hello

I have a scenario where i have to abort the job if i see any rejects out of oracle stage.I am doing only inserts in the oracle stage. So i have changed the property in the oracle stage to ouput reject rows=true. But the requirement is i need to capture the first rejected record from the oracle stage in a file so that i can send email to the support team and then i have to abort the job.
my job design is as below


seqfile----trf----oracle------trf---seqfile

i used abort after 1 row property in the transformer coming out of orcle. the job is getting aborted but when i see the rejected File it is empty. Is there a way that i can achiveve it.

Thanks

Posted: Sun Dec 06, 2009 9:41 pm
by ray.wurlod
Try setting the abort count to 2, so that at least one row gets out.

Posted: Sun Dec 06, 2009 10:31 pm
by dodda
Hello Ray,

Thanks. I tried that and the job is getting aborted but i dont see the first row written to the file instead a zero byte file is produced. I even tried using peek stage and from peek stage i have written to a Seq File. But in vain. Is there another way.

Thanks for the help

Posted: Mon Dec 07, 2009 3:29 am
by Sainath.Srinivasan
As DataStage runs in parallel mode, the abort may kill the process before the data is flushed into the file.

Simplest way will be to use a peek stage and pick the data from the logs.

Posted: Mon Dec 07, 2009 7:00 am
by dodda
Hello sainath,

Thanks for the reply. Can you help me how to pick the data from the log.