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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.