Hello: I couldn't create an excel file that has macro value in the file name. I got error: ERROR: Physical file does not exist, H:\\test 16\07\2020.xlsx. I tested without using the &run_date macro variable, the code worked fine. Thanks for any help! Data _null_;
call symput("run_yyyy" , put(year(date()), Z4.));
call symput("run_mon" , put(month(date()), Z2.));
call symput("run_day" , put(day(date()), Z2.));
call symput("run_hour" , put(hour(datetime()), Z2.));
call symput("run_min" , put(minute(datetime()),Z2.));
run;
%let run_date = &run_day./&run_mon./&run_yyyy.;
/* I also tried:
%let filepath = " PATH...\test &run_date..xlsx";
ods excel file=&filepath
*/
ods excel file=" PATH...\test &run_date..xlsx"
options(embedded_titles="yes" sheet_name="test" sheet_interval='none');
title "test";
proc print data=sashelp.cars;
run;
title;
ods excel close;
... View more