Hello,
Quick preface: I am very new to using macro language, so I could be missing something relatively easy here.
I have a report built through enterprise guide that I'm exporting using an ODS Excel line, this all works fine.
However, I'm trying to adjust the filename portion to include today's date. So I created a variable to pull the system date.
Now, I had this working momentarily, but when i went to adjust the field to the live location, i must have changed something and can no longer get it to work. I feel like I'm overlooking something simple.
%LET _CLIENTTASKFILTER = Location = 'HCC';
%let Date = %sysfunc(today(), yymmddn8.);
%put &todaysDate;
TITLE"Leads Performance";
FOOTNOTE;
/* -------------------------------------------------------------------
Run the tabulate procedure
------------------------------------------------------------------- */
ods excel file='\Reporting\Leads&Date..xlsx' style=htmlblue;
However, the file is just exporting exactly as printed and not referencing the &date but i can see the date working properly in the log.
26 %LET _CLIENTTASKFILTER = Hub_Location = 'HUBHCC';
27 %let Date = %sysfunc(today(), yymmddn8.);
28 %put &todaysDate;
20190513
29
30 TITLE"Leads Performance";
.
.
150 ODS _ALL_ CLOSE;
NOTE: Writing EXCEL file: \Reporting\Leads&date..xlsx
Hello @Erict and welcome to the SAS Support Communities!
The single quotes around the path prevent the resolution of the macro variable reference (&Date.). Replacing them with double quotes should solve the problem.
Hello @Erict and welcome to the SAS Support Communities!
The single quotes around the path prevent the resolution of the macro variable reference (&Date.). Replacing them with double quotes should solve the problem.
Awesome, I knew it would be something simple that I was overlooking.
Thanks so much for your time !
-Eric
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.