BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Erict
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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.

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

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.

Erict
Calcite | Level 5

Awesome, I knew it would be something simple that I was overlooking.

 

Thanks so much for your time !

 

-Eric

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2429 views
  • 1 like
  • 2 in conversation