Just sending ERROR messages without the surrounding code is useless (you can see how useless this is in many threads here with suboptimal questions). Send the whole log instead, or even better, send a link to the log.
I have created a framework where every individual batch job run creates a separate log file; a listing of job runs is kept, with links to the logs (they can be accessed by the web server); if the wrapper script (sasbatch) detects a non-zero return code from a SAS job, a notification is triggered.
When I receive a notification, I call up the list of job runs, click on the failed job, and get the whole log.
... View more