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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.