Hi
Please any body share some routine snippet with a perfect error handling of the parallel job call.
TIA
Abhi
Running & error handling of Parallel Job from Server Rou
Moderators: chulett, rschirm, roy
-
Abhijit180
- Participant
- Posts: 1
- Joined: Thu Oct 09, 2008 1:35 am
- Location: Prague
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
ErrMsg = ""
RoutineName = "MyRoutine"
hJob = DSAttachJob(TheJobName, DSJ.ERRNONE)
JobName = DSGetJobInfo(hJob, DSJ.JOBNAME)
If JobName Matches "'-'1N0N"
Then
ErrMsg = "Could not attach job."
End
Else
* Optionally include call to DSPrepareJob here to "reset if required".
GoSub SetParameters
* how this is done depends heavily on where you get your parameter values
ErrCode = DSRunJob(hJob, DSJ.RUNNORMAL)
If ErrCode Matches "'-'1N0N"
Then
ErrMsg = "Run request failed. Error code = " : ErrCode
End
Else
ErrCode = DSWaitForJob(hJob)
ExitStatus = DSGetJobInfo(hJob, DSJ.JOBSTATUS)
Ans = ExitStatus
Begin Case
Case ExitStatus = DSJS.RUNOK
Call DSLogInfo("Job finished OK", RoutineName)
Case ExitStatus = DSJS.RUNWARN
Call DSLogWarn("Job finished with at least one warning.", RoutineName)
Case ExitStatus = DSJS.RUNFAILED
Call DSLogWarn("Job failed (aborted).", RoutineName)
Case ExitStatus = DSJS.STOPPED
Call DSLogWarn("Job stopped by operator.", RoutineName)
Case @TRUE ; * otherwise
Call DSLogWarn("Job exit status is " : ExitStatus : ".", RoutineName)
End Case
End
ErrCode = DSDetachJob(hJob)
End
If ErrMsg > ""
Then
Call DSLogWarn(ErrMsg, RoutineName)
Ans = -1
EndIBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.