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

Hi everyone,
I have an issue,

I would like to modify automatically my date in my ods excel path, but it doesn't work.

here my code :

%let date=20210101;

ods excel file='C:\Users\JOLYFI\Desktop\4M - Defaut DOU\DOUWEB_FACTO_&Date..xlsx'
    options(sheet_name='facto');

proc report data=DOUWEB_FACTO_&Date.;
run;

ods excel close;

when i run it, I have this title on my excel : DOUWEB_FACTO_&Date..xlsx instead of DOUWEB_FACTO_20210101.xlsx 

Someone know how to do ?

thank you

1 ACCEPTED SOLUTION

Accepted Solutions
mklangley
Lapis Lazuli | Level 10

Try changing the single quotes around the path to double quotes. That way the macro variable &Date can resolve--it won't resolve inside single quotes.

ods excel file="C:\Users\JOLYFI\Desktop\4M - Defaut DOU\DOUWEB_FACTO_&Date..xlsx"

 

View solution in original post

1 REPLY 1
mklangley
Lapis Lazuli | Level 10

Try changing the single quotes around the path to double quotes. That way the macro variable &Date can resolve--it won't resolve inside single quotes.

ods excel file="C:\Users\JOLYFI\Desktop\4M - Defaut DOU\DOUWEB_FACTO_&Date..xlsx"

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 477 views
  • 2 likes
  • 2 in conversation