This whole thing is working fine when the jobs in the list are run with status DSJS.RUNOK and DSJS.RUNWARN.
But when a job from the list aborts - status DSJS then even the main job which is calling all the other jobs also aborts. How can i prevent the main job from aborting. the job that calls the other jobs has a routine that looks like this
where JobName is the name of the job to be runJobHandles = DSAttachJob(JobName,DSJ.ERRNONE)
ErrCode = DSWaitForJob(JobHandles)
JobHandles = DSPrepareJob(JobHandles)
ErrCode = DSWaitForJob(JobHandles)
RunErr = DSRunJob(JobHandles, DSJ.RUNNORMAL)
begin case
case RunErr = DSJE.BADHANDLE
call DSLogFatal("Bad Job Handle", JobName)
case RunErr = DSJE.BADSTATE
call DSLogFatal("Bad Job State", JobName)
end case
ErrCode = DSWaitForJob(JobHandles)
ErrCode = DSGetJobInfo(JobHandles, DSJ.JOBSTATUS)
begin case
case ErrCode = DSJS.RUNFAILED
call DSLogFatal("Job Run Failed", JobName)
Result = 3
case ErrCode = DSJS.RUNOK
call DSLogInfo("Job Completed Successfully", JobName)
Result = 1
case ErrCode = DSJS.RUNWARN
call DSLogWarn("Job Completed with Warnings", JobName)
Result = 2
case ErrCode = DSJS.STOPPED
call DSLogWarn("Job was Stopped by User", JobName)
Result = 4
end case
if RunErr <> 0 Then
ErrCode = DSDetachJob(JobHandles)
Abort
End
ErrCode = DSDetachJob(JobHandles)
Ans = Result