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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.