Page 1 of 1

How to abort a job when there is fatal error in log?

Posted: Mon Apr 21, 2008 12:02 pm
by via
We are running a job which loads the database.
The job has sequential file--->transformer--->odbc stages.
The job finished successfully with out warnings.When we check the job log, there are fatal errors(deadlock occured).
The job should abort if there are any fatal errors! right?
These error messages are related to database(DB2).
Is there anyway to set our job to abort, when there is any fatal error in the log?

Thanks in advance

Via

Posted: Mon Apr 21, 2008 1:02 pm
by kumar_s
Does this happen for every run? How do you execute the job?
Any special arrangments made for Mssage handler or Check point restratablilty?

Posted: Mon Apr 21, 2008 1:23 pm
by via
Hi Kumar, there are no message handlers defined. Actually there are duplicates in the input file to the database.So, dead lock situation occured, But wondering
whatever is the case, datastage is throwing fatal error and could not abort that job.

Posted: Mon Apr 21, 2008 1:58 pm
by savis
Hi,

hope this helps...

A terminator stage can be placed in a job sequence to ensure that a job is stopped cleanly if ther are fatal errors.

1) use a job activity stage and select the expression type as failed

2) use a terminator stage and stop all the other subordinate jobs if required..

Thanks,
Savis

Posted: Mon Apr 21, 2008 2:22 pm
by via
Hi Savis,
What you are saying is correct. But my job is not failing(even though fatal errors)....the status after the job run is finished.So i cant use terminator.
I am running this job individually not through sequence.
Thanks

Posted: Mon Apr 21, 2008 5:10 pm
by ray.wurlod
When you run a job you can set a maximum number of warnings. The job will abort when this number of warnings is exceeded. A value of 0 means that the job can generate an unlimited number of warnings and still run to completion.

Posted: Tue Apr 22, 2008 5:08 am
by bikan
May be a afterjob subroutine / routine to search through log file for fatal entries and then stop sequencer based on result.

I am sure there are function like Getloginfo ...etc which will give if log contains fatal msg or not....

Posted: Tue Apr 22, 2008 7:09 am
by via
Thanks Ray and bikon.
Ray, there are no warning messages at all in the job log except few fatal error mesasges.
bikon, i am not familiar with routines..may be i should look into them..

Thanks

Posted: Wed Apr 23, 2008 2:37 pm
by kumar_s
But that is work around to abort the job. But you ll need to check why does it finishes successfully when you get a Fatal Error.
As asked already, do you get this issue everytime you run the job?