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.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.