BookmarkSubscribeRSS Feed
Abraham
Obsidian | Level 7

Hello Everyone!

While sending the mail to the sender, it is not possible to identify whether the mail has already reached or not.Is there any option to track it.

or

is it possible  that if error is found in the log file, then one mail will automatically comes to sender saying that the mail has not been transmitted (with attached log file).

and if not found, also mail comes with message showing that the mail has been send successfully.

FILENAME Mailbox EMAIL   from=("vinxa@oracle.com")

to=("vin@oracle.com")

Subject="test"

put "mail sent successfully"

RUN;

Thanks in advance

2 REPLIES 2
Patrick
Opal | Level 21

You're handing over your email to the mail server. Once the mail server has accepted it you're out of the equation.

It is also not guaranteed that the receiving mail server sends a confirmation that you've used a valid email address and it most certainly doesn't send any information whether the receiver has opened the email or not.

Bounce message - Wikipedia, the free encyclopedia

So maximum you could achieve is get some kind of admin access to the sending mail server and check the send status of emails - but that's only one more step and won't give you the full picture.

Quentin
Super User

Hi,

For second part of your question, one way to do this would be to use a log scanning macro which would read the log for any errors/warnings/bad notes and create a macro variable indicating if the log scan passed (no errors found) or failed.

So something like:

%macro EmailReportIfCleanLog(...) ;

%logscan()

%if &LogScanResult=PASS %then %do;

  %* email report to user ;

  %* email programmer that program ran fine;

%end;

%else %if &LogScanResult=FAIL %then %do;

  %* email programmer that program failed;

%end;

%mend;

You can search lexjansen.com for papers on log scanning.  My favorite approach is described in http://www.nesug.org/proceedings/nesug01/cc/cc4008.pdf , but unfortunately they couldn't share the full code in the paper.

If you go this approach, and want to be sure the programmer gets an email even when there are errors in the log, you have to manually recover from SYNTAXCHECK mode.  So if SAS set obs=0 due to some error in your main code, I  *think* you need to set OBS=max REPLACE NOSYNTAXCHECK at the top of your log checker.

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 2 replies
  • 1215 views
  • 0 likes
  • 3 in conversation