Abort Sequence after Some time
Moderators: chulett, rschirm, roy
Abort Sequence after Some time
Hi
I have a requirement Where I need to Abort a sequence when the Current time reaches 7:30 AM, Means after 7:30AM Sequence should not continue, If it running It should Abort.
Please advise In this regard.
Thanks
I have a requirement Where I need to Abort a sequence when the Current time reaches 7:30 AM, Means after 7:30AM Sequence should not continue, If it running It should Abort.
Please advise In this regard.
Thanks
2 B 1 4 ALL
The only way a Sequence could do something like this to itself is inbetween activities, but that's not necessarily going to handle the "abort right smack at 7:30" part if (for example) it's in the middle of a long Job Activity.
What you need is another process to monitor the Sequence job. One of the basic functionalities of any job control process is the ability to handle something that's been running "too long". One way we've done something like this is using an Enterprise Scheduler. They can easily check a process at a particular time and if found to be still running at a particular threshold (run time or clock time) can either issue an alert or can attempt to kill the other process from the Enterprise Scheduler itself.
Another choice, one more "DataStage centric", would be to write a small bit of BASIC job control code to check the status of the Sequence job. If it is not found to be running, do nothing. If running, issue a Stop request to either the Sequence itself or the currently controlled running job.
What you need is another process to monitor the Sequence job. One of the basic functionalities of any job control process is the ability to handle something that's been running "too long". One way we've done something like this is using an Enterprise Scheduler. They can easily check a process at a particular time and if found to be still running at a particular threshold (run time or clock time) can either issue an alert or can attempt to kill the other process from the Enterprise Scheduler itself.
Another choice, one more "DataStage centric", would be to write a small bit of BASIC job control code to check the status of the Sequence job. If it is not found to be running, do nothing. If running, issue a Stop request to either the Sequence itself or the currently controlled running job.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Personally I will do a timing on the jobs and raise alarm of anything behind schedule.
For your requirement....
Split your seq start to call a sleep activity until 7:30 and join it to output link from last stage into a sequence stage.
Output link of seq stage pointing to kill anything still running.
Or simply kill any ds phantoms hanging at 7:30.
For your requirement....
Split your seq start to call a sleep activity until 7:30 and join it to output link from last stage into a sequence stage.
Output link of seq stage pointing to kill anything still running.
Or simply kill any ds phantoms hanging at 7:30.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Or simply a Routine activity (sleep until 07:30) with an unconditional link to a Terminator, these in the same job sequence as everything else.
The Terminator can send Stop requests to every activity currently running under control of the job sequence in which it occurs.
The Terminator can send Stop requests to every activity currently running under control of the job sequence in which it occurs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 597
- Joined: Fri Apr 29, 2005 6:19 am
- Location: Singapore
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
ray.wurlod wrote:It's a solution. I don't particularly like it, but it's a solution. ...
Well this approach can give the desired result but what is in my mind currently i am writing the same
1. At the begining of the top sequence write 0 to a file or environment variable or some where else where it static during the execution.
2. At last if every thing finishes successfully change value to 1.
3. Routine (sleep till 7:30 modified) with conditional trigger to terminator.
Routine (sleep till 7:30 modified) - you may wish to break this in parts
1. don't sleep.
2. Keep reading for that file every half an hour.
3. Keep track of time.
if the value in file changes to 1 return 0. No need to trigger the terminator.
if its 7:30 and the value in that file is still 0 then
1. return 1
2.you may wish to give a custom message
3. call terminator to abort everything.
this is the solution in datastage. but I prefer putting a shell script in cron and cheking the status and aborting from there itself.
Please let me know if there is any descripency or if you think it won't work or you have a better solution because I never tried it.
Regards,
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.