Hi
I am using datastage job control to call some depandent sub jobs,before run I want to reset these jobs if these jobs having status stopped and abort . can somebody help me to find out code for this .
how can we reset a datastage job using datastage coding
Moderators: chulett, rschirm, roy
how can we reset a datastage job using datastage coding
Regards,
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
Hi
I am using this code to run a job using job control ,
so i need to put DSJ.RUNRESET instead of DSJ.RUNNORMAL, m i right. but if job is already in a runable state then below code will work or not ?
ErrCode = DSRunJob(hJob17, DSJ.RUNRESET)
I am using this code to run a job using job control ,
so i need to put DSJ.RUNRESET instead of DSJ.RUNNORMAL, m i right. but if job is already in a runable state then below code will work or not ?
ErrCode = DSRunJob(hJob17, DSJ.RUNRESET)
Regards,
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
DSRunJob(hJob17, DSJ.RUNRESET) Will reset the job. You need to use DSJ.RUNNORMAL to run the job again.
Reseting the finished job shouldnt be an issue, unless you expect to get its status. Perhaps you can check for the status and then you can reset.
Reseting the finished job shouldnt be an issue, unless you expect to get its status. Perhaps you can check for the status and then you can reset.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Re: how can we reset a datastage job using datastage coding
I doing something exactly what you need..to check a job's status..if aborted/stopped..then reset..see if the code below helps..
* Check XXX JOBSTATUS. If the status is abort then reset the job before running
haddrr1 = DSAttachJob("XXX", DSJ.ERRFATAL)
Status = DSGetJobInfo(haddrr1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Or Status = DSJS.STOPPED Then
ErrCode = DSRunJob(haddrr1, DSJ.RUNRESET)
ErrCode = DSWaitForJob(haddrr1)
End
ErrCode = DSDetachJob(haddrr1)
* Check XXX JOBSTATUS. If the status is abort then reset the job before running
haddrr1 = DSAttachJob("XXX", DSJ.ERRFATAL)
Status = DSGetJobInfo(haddrr1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Or Status = DSJS.STOPPED Then
ErrCode = DSRunJob(haddrr1, DSJ.RUNRESET)
ErrCode = DSWaitForJob(haddrr1)
End
ErrCode = DSDetachJob(haddrr1)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Create a job sequence containing a job activity. Set the run property to "reset if required, then run". On the job properties window examine the code produced by compiling this job sequence. Emulate that code.
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.