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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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