I would look on lexjansen.com for papers with examples.
My approach:
SAS job starts by using PROC PRINTTO to send the log to a file.
At the end of the job, scan the the log file to look for any errors, warnings, or bad notes. Save those messages. (Note before the step that scans the log, set options obs=max replace NoSyntaxCheck in order to recover from syntaxcheck mode. Without that, if SAS has entered sytaxcheck mode your log scan will not run.)
If any bad log messages were found, send an email, with the name of the program, the messages found, link to the log file, etc.
I also append the data to a job history table, so I can see the full history of job runs, when they errored, number of obs written, etc. Also I run a nightly job that checks to make sure all expected jobs have run in the past 24 hours.
If you start with getting the log scanning working, then sending the email is pretty straight forward.
So you could start by looking on lexjansen.com for log scanning papers, then look for emailing papers.
The other option is to use your scheduler software, and pick up job return codes. The only down side of that is that bad log notes may not trigger a non-zero return code. But there are system options that allow you to turn most bad log notes into warnings or errors, so this may not be much of an issue.
... View more