FUNCTION ResetJobs(IgnoreMe)
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
JobList = DSGetProjectInfo(DSJ.ME, DSJ.JOBLIST)
Convert "," To @FM In JobList
Ans = 0
ResetCount = 0
Loop
Remove JobName From JobList Setting MoreJobs
hJob = DSAttachJob(JobName. DSJ.ERRNONE)
If hJob = DSJ.ME Then Continue ; * do not bother with current job
JobStatus = DSGetJobInfo(hJob, DSJ.JOBSTATUS)
If JobStatus = DSJS.RUNFAILED
Then
Call DSLogInfo("Resetting job " : DQuote(JobName), "ResetJobs")
* Ideally you would get parameter values from previous run and set them here.
* You should also include error checking.
ErrCode = DSRunJob(hJob, DSJ.RUNRESET)
ResetCount += 1
End
ErrCode = DSDetachJob(hJob)
While MoreJobs
Repeat
Call DSLogInfo(ResetCount : " jobs were reset.", "ResetJobs")
RETURN(Ans)