I have the following code:
%let host = HostThatSendsEmail;
%let todayDate = &SYSDATE9;
signon host;
rsubmit;
filename mail email to = ("PersonGettingEmail")
from= "PersonSendingEmail"
SUBJECT="Today is &todayDate";
data _null_;
file mail;
put 'Dear All';
put 'Today is &todayDate';
run;
endrsubmit;
The macro date does not get inputed into the email when the code is run. The resulting email should read:
Dear all
Today is 29Mar12.
Instead it reads:
Dear all
Today is &TodayDate
Is there some piece of code I am missing?
You created the macro locally…but then you signed on to a remote host. Your remote session of SAS doesn’t know about the macro on the local host.
Using %SYSLPUT is one way to solve this problem (Another link).
Place this code between the SIGNON and the RSUBMIT
If you had a large number of macro vars that you wanted available on the remote host. You could write them to a data set and use PROC UPLOAD to move the data set to the remote host.