Hello Cynthia,
Could you also please provide advice on how I can fix my code?
This is my code:
%let date = %sysevalf('31mar2020'd);
data _null_;
call symput('z', put(&date, monyy5.));
run;
proc export data=sashelp.cars
outfile='/team_folder/&z.xlsx'
dbms=xlsx
replace;
run;After running the code the filename of the saved file is &z.xlsx instead of MAR20.xlsx.
Appreciate your help.
Thanks,
Elle
Best not to ask new questions in a 17 year old thread.
In this case, the answer is simple: use double quotes around any text that includes macro variables. However file names that have dates such as MAR20 is a bad idea, because these will not sort properly, you will find that APR is the first month and AUG is the second month and so on. Better to use 2020M03 or something like that.
Next time, start a new thread.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.