I am trying to import 1 file name on Mondays and another file name on Tue-Fridays. For example, on Monday I want to import the file from Saturday but on Tue-Fri I want to import the file for the current day. This is what I am trying. It doesn't seem to read the &today macro at all. Code: %let today=%sysfunc(putn(%sysfunc(date()),yymmddn8.)); %let today2=%sysfunc(PUTN(%eval(%sysfunc(date()) - 2), yymmddn8.)); %macro setdate(date); %let date= weekday(today()); %if &date = 2 %then %do; proc import out=M_IMPORT datafile="<path>/test/M_Daily_Admissions_&today2..csv" dbms=csv replace; datarow=2; getnames=no; run; %end; %else %if &date <> 2 %then %do; proc import out=M_IMPORT datafile="/<path>/test/M_Daily_Admissions_&today..csv" dbms=csv replace; datarow=2; getnames=no; run; %end; %mend setdate;
... View more