Trapping Failed Job

Post Reply
User avatar
Fang502002
Nouveau
Nouveau
Posts: 2
Joined: 09 Apr 2008 12:00

Trapping Failed Job

Post by Fang502002 » 23 Sep 2010 12:08

Hi All;

I am running ControlM Enterprise ver 6301.500, and I would like to know if it is possible to trap a failed block. What I want to do is when a block runs for under 1hr, and ends sucessfully, the job that follows checks the previous jobs log, and based on a runtime less than 1hr, fail, thus causing no further jobs to run.

The reason for this is that we have a job that runs for over 1.5hrs but when it fails , due to no erro trapping for this it does not fails, as the runtimes are so eratic......it can fail after 5 min or after 65min....

Any help would be appreciated.

User avatar
gbyrnes
Nouveau
Nouveau
Posts: 8
Joined: 05 May 2010 12:00
Location: Melbourne, Australia

Post by gbyrnes » 24 Sep 2010 7:06

Hi Fang,

This is quite a strange request (as the recommendation is to fix your return codes!), but here goes.

At the start of the first Job you need to set a Global Autoedit variable to a value from the Operating system representing the "POSIX date" (i.e. the number of seconds since 1970).

At the end of the last Job in the flow before the check Job you do the same with another variable.

You then do a calculation of the End-time minus the Start-time, and if the difference is greater than the number of seconds in 1 hour then the Job will END NOTOK (courtesy of an On Statement), and the flow will not continue.

I am recommending the use of the POSIX date from the operating system for the variables because it is too difficult to do calculations on the hhmmss vaue you receive from the Control-M %%TIME.

Good luck...
Cheers, Graeme.

Post Reply