Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
JobName=Trim(Arg1)
JobHandle = DSAttachJob (JobName, DSJ.ERRWARN)
Status = DSGetJobInfo (JobHandle, DSJ.JOBSTATUS)
If Status= DSJS.RUNFAILED or Status= DSJS.CRASHED
THEN
ErrCode=DSRunJob(JobHandle , DSJ.RUNRESET )
ErrCode=DSWaitForJob(JobHandle)
END
ErrCode=DSRunJob(JobHandle , DSJ.RUNNORMAL )
ErrCode=DSWaitForJob(JobHandle)
ErrCode=DSDetachJob(JobHandle)
Ans=ErrCode
My requirement is that it should reset as well run the job if the job is in not runnable state.
Pls advice where I am missing