Hello All,
Some one please help me to get a correct code .
i want to send email with first error message from log if my job get failed , if job success then no email required.
I tried multiple ways but facing different - different issues.some times sends last error message, some time get first line of error but not taking second line if error string is more than one line and so on.
If anyone have clean code please share .
Thanks
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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.