Abort job if ran more than 30 minutes

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
wittyme
Premium Member
Premium Member
Posts: 151
Joined: Tue Sep 15, 2009 2:03 pm
Location: Chicago

Abort job if ran more than 30 minutes

Post by wittyme »

How to abort a parallel job or sequence if it is running more than 30 minutes?

I searched the forum and I couldn't find any particular answer. We use a scheduling tool and that creates a ticket if it exceeds max time out.

But I need to abort the datastage job. Just want to know if there is any environment variable for this.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Why you want to abort the job if it reaches 30 minutes mark. There might be much more data in input than expected, to make it cross the timelimit defined?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
wittyme
Premium Member
Premium Member
Posts: 151
Joined: Tue Sep 15, 2009 2:03 pm
Location: Chicago

Post by wittyme »

The data in the file is very less. The job hangs due to DS administration issues which I am not sure of.

If I abort the job so it will run again as the job is scheduled within short intervals of time if not it will wait until someone manually go into director and abort it. The job runs throughout the day.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Have your scheduling tool issue the stop request from the command line.
-craig

"You can never have too many knives" -- Logan Nine Fingers
wittyme
Premium Member
Premium Member
Posts: 151
Joined: Tue Sep 15, 2009 2:03 pm
Location: Chicago

Post by wittyme »

No, it doesn't.

I read in an other blog that it cannot be done inside the job and has to have a different job to monitor it.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That wasn't a question. If your scheduler creates a ticket when the threshold is passed, why not have it also stop the job?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sudha03_vpr
Participant
Posts: 34
Joined: Tue Feb 26, 2013 9:36 am
Location: Chicago

Post by sudha03_vpr »

You can probably write a shell script using dsjob command to stop the job if the DSJ_JOBELAPSED (gets the elapsed time in seconds) > 1800 seconds. What scheduler do u you use to trigger the jobs ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use a Constraint expression that tests how long it has been since the job started and send the row down an output link with a row count limit of 1.

In a sequence remember the job start time using a User Variables activity and, at specific places in the sequence, compare this against current time.

Neither of those will work if the "running" time is increasing because of waiting on an external resource, such as a lock (deadlock) in a database.

Ideally, as others have noted, monitor externally to the job/sequence and issue Stop request.
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