Hi,
Please let me know how to create a routine that checks the DS Job status and Reset if the status of the job is Abort.
Regards
Pavithra
To Reset the DS Job if the status is Abort using Routine
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 13
- Joined: Thu Mar 17, 2005 1:20 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi pavithra,
This is the routine to reset the job.
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
If DSGetJobInfo(hJob, DSJ.JOBSTATUS) = DSJS.STOPPED or DSGetJobInfo(hJob, DSJ.JOBSTATUS) = DSJS.RUNFAILED
or DSGetJobInfo(hJob, DSJ.JOBSTATUS) = DSJS.CRASHED
Then
Message = "Job is resetting..."
Call DSLogInfo(Message, RoutineName)
ErrCode = DSRunJob(hJob, DSJ.RUNRESET)
Ans = ErrCode
Status = DSGetJobInfo(hJob, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Then
Message = "Job Reset Failed: ":hJob:"."
Call DSLogWarn(Message, RoutineName)
End
End
Thanks,
Siva
This is the routine to reset the job.
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
If DSGetJobInfo(hJob, DSJ.JOBSTATUS) = DSJS.STOPPED or DSGetJobInfo(hJob, DSJ.JOBSTATUS) = DSJS.RUNFAILED
or DSGetJobInfo(hJob, DSJ.JOBSTATUS) = DSJS.CRASHED
Then
Message = "Job is resetting..."
Call DSLogInfo(Message, RoutineName)
ErrCode = DSRunJob(hJob, DSJ.RUNRESET)
Ans = ErrCode
Status = DSGetJobInfo(hJob, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Then
Message = "Job Reset Failed: ":hJob:"."
Call DSLogWarn(Message, RoutineName)
End
End
Thanks,
Siva
You caught me out; I noticed the omission when I posted yesterday and was too lazy to go back and edit the post; even though I knew that you would notice and correct my error.ray.wurlod wrote:... and a DSDetachJob to indicate that you're finished with it and another process doesn't get a "locked" message.