G.Gajardo
G.Gajardo

Reputation: 38

SAS automail not working

I am new at SAS and I have this SAS macro, it will send me a email when the process has finished, but it is not working properly.

In the log just say macros's name like it work but the email is not coming to my inbox.

%macro mailing()
 data _null_;

  start = %eval(%sysfunc(today(), mmddyy5)-1);
  endd =  %eval(%sysfunc(today(), mmddyy5)-8);
run;

FILENAME mail EMAIL
  SUBJECT=" corporative subject"
  FROM='[email protected]'
  SENDER='[email protected]'
  TO=("[email protected]")


  DATA _NULL_;
  FILE mail;
    PUT "Hi,";
    PUT "here goes &start. - $endd. ";
    PUT "Best Regards,";
    PUT "me";

RUN;
%mend

%macro mailing()

By the way, I do not know if those date variables are properly defined

Upvotes: 1

Views: 81

Answers (1)

Allan Bowe
Allan Bowe

Reputation: 12701

The issue is that you are not actually calling the macro. You only use %macro when defining a macro.

To call it, simply precede the macro name with a % symbol, as follows:

%mailing()

Upvotes: 2

Related Questions