I am looking to save a dataset to an excel and have it save the filename with the current date.
To narrow down the issue, I am looking for code that saves the excel to a path made by combining these 3 things together: '/sas/myPath/results', '3-22-2018', and '.xlsx'.
I can't just say:
%let filePath = '/sas/myPath/results3-22-2018.xlsx';
because the date will be updated dynamically. The error is the libname referring to a cats function. Any ideas on how to fix this?
/*Set File Path*/
data _null_;
%let filePath = cats('/sas/myPath/results', '3-22-2018', '.xlsx');
run;
/*Output to excel*/
libname excelOut XLSX &filePath;
data excelOut.Sheet1;
set results;
run;
libname excelOut clear;