Parameter: jobname - name of reseting job
$INCLUDE DSINCLUDE DSJ_XFUNCS.H
$INCLUDE DSINCLUDE JOBCONTROL.H
JobHandle = DSAttachJob(jobname, DSJ.ERRNONE)
if JobHandle = 0 Then
Call DSLogFatal('Job ' : jobname :' is not found', 'jobReset')
Ans = 1
End Else
jobstatus = DSGetJobInfo(JobHandle, 1)
if jobstatus <> DSJS.RUNNING Then
Call DSLogInfo('Job ' : jobname :' is not running', 'jobReset')
if jobstatus = DSJS.RUNFAILED Then
Call DSLogInfo('Job ' : jobname :' is aborted. Try to reset it', 'jobReset')
RunErr = DSRunJob(JobHandle, DSJ.RUNRESET)
if RunErr = 0 Then
Call DSLogInfo('Job ' : jobname :' is reset', 'jobReset')
End
End
End
Ans = 0
End