Stop the sequence at specific time
Moderators: chulett, rschirm, roy
Stop the sequence at specific time
I have a datastage sequence which runs for 24 hours. I want stop this job on friday night and restart again on monday morning. Restarting can be done manually. Any pointers how to stop at specific time? This should be graceful exit and job should be in stopped/restartable state and not in aborted.
Sachin C
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Depends, but almost certainly not. A sequence spends most of its time uninterruptably asleep waiting for activities to finish. If you check the system time after each activity finishes you can direct control to an "ending" path. The more complex the sequence, the more additional activities you will need to implement the design.
You can use a job control routine using the sequence generated code as the prototype, and replace the DSWaitForFile() function with our own code that checks the time at each pulse of the "busy wait". But what do you want to happen to activities that are already running in this case?
You can use a job control routine using the sequence generated code as the prototype, and replace the DSWaitForFile() function with our own code that checks the time at each pulse of the "busy wait". But what do you want to happen to activities that are already running in this case?
Last edited by ray.wurlod on Thu Jul 01, 2010 3:15 am, edited 1 time in total.
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.
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
As Ray notes, you need to build that functionality in. I always have some kind of "date/time/loop" check built in so it can gracefully stop on its own and add a polling step so I can touch a stop file into existence and it will notice and again do a graceful shutdown.
-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
As everyone will say and agree, a graceful termination is better than killing the process. Also it is cleaner to maintain without any threads hanging.
One possibility I thought about is to decrease the priority of DataStage with Unix nice command to such a level that the OS will not even bother about it.
Alternatively you can schedule a non-DataStage command with high priority during the weekend to keep all other process asleep.
But note that this is your OS level and impacts all other process too.
One possibility I thought about is to decrease the priority of DataStage with Unix nice command to such a level that the OS will not even bother about it.
Alternatively you can schedule a non-DataStage command with high priority during the weekend to keep all other process asleep.
But note that this is your OS level and impacts all other process too.
I had done this around 4 years ago with datastage sequences and datastage Command lineinterface. Create a scheduled job that will create a dummy file whenever the main sequence needs to be stopped, introduce a wait for file condition in a loop wrapping the main sequence , when file is found use a command activity to stop the job using ( I know there is a way to stop a job using dsjob - you could get it in the documentation..), and optionally cleanup the dummy file with another command ..
HTH
Ramesh
Code: Select all
dsjob -stop
HTH
Ramesh