Can anyone show me the code to a after job routine wich resets a server job after its finished, no matter the errorcode?
Regards
How to make a after job routine which resets a server job
Moderators: chulett, rschirm, roy
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Welcome aboard! :D
You can't reset the job itself from within an after-job subroutine because, while the after-job subroutine is executing, the status of the job is still "running". The job does not stop running until after the after-job subroutine returns. You can not reset a job if its status is "running".
Is that what you had in mind to do?
You can certainly reset an attached job from job control code, using DSRunJob() with a run-type argument of DSJ.RUNRESET. But not if the job is currently running.
What are you hoping to achieve here? Would it be as acceptable to reset the job if required just before running it the next time? From a job sequence this is one of the options in a Job Activity; how to do it in job control code has been discussed on this Forum. Search, perhaps, for DSJ.RUNRESET.
You can't reset the job itself from within an after-job subroutine because, while the after-job subroutine is executing, the status of the job is still "running". The job does not stop running until after the after-job subroutine returns. You can not reset a job if its status is "running".
Is that what you had in mind to do?
You can certainly reset an attached job from job control code, using DSRunJob() with a run-type argument of DSJ.RUNRESET. But not if the job is currently running.
What are you hoping to achieve here? Would it be as acceptable to reset the job if required just before running it the next time? From a job sequence this is one of the options in a Job Activity; how to do it in job control code has been discussed on this Forum. Search, perhaps, for DSJ.RUNRESET.
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.