Hi ,
I am trying to implement mail notification from a batch.I want to send an email if any job in the batch fails which will include the reason for failure.I know to implement it via graphical sequencer but not sure how to include in a batch code.
I am attaching the batch code below, please guide me how to call the DSSendMail routine in case of failure at the end of every job.
RunJobs:
* Setup XYZ, run it, wait for it to finish, and test for success
hJob1 = DSAttachJob("XYZ", DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed: XYZ", "JobControl")
Abort
End
ErrCode = DSSetParam(hJob1, "Arg1", Arg1)
ErrCode = DSSetParam(hJob1, "Arg2", Arg2)
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: XYZ", "JobControl")
End
Thanks
Mail Notification
Moderators: chulett, rschirm, roy
Shiva459,
on page 6-188 of the BASIC Guide you will find the exact description on how to do this; as this is very straightforward programming I am not sure where your problem is.
You need only add:
on page 6-188 of the BASIC Guide you will find the exact description on how to do this; as this is very straightforward programming I am not sure where your problem is.
You need only add:
Code: Select all
ParameterString = "From:Pseudo@Nominus.Com\nTo:Shiva459@SFBay.Org\nSubject:DSSendMail Function Call\nBody:\n"
ReturnCode = DSSendMail(ParameterString)
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: