BookmarkSubscribeRSS Feed
AshwaniGupta
Calcite | Level 5

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  

1 REPLY 1
Kurt_Bremser
Super User

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.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 950 views
  • 0 likes
  • 2 in conversation