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

Hello Experts,

 

I'm wondering how to create a macro variable with spaces : %let Feuille = Villes et rues

I would like to use this macro varaible in proc export's sheet statement :

.....

dbms=xlsx replace;
sheet="&Feuille .";

.....

 

Thank you for your help !

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Just make sure there's no blank between the macro variable name and the dot:

%let Feuille = Villes et rues;

proc export
  data=sashelp.class
  file="/folders/myfolders/class.xlsx"
  dbms=xlsx
  replace
;
sheet="&Feuille.";
run;

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

I'm not sure what the question is, the code you provided (if you add a semi-colon at the end of the %LET statement) should work perfectly.

--
Paige Miller
Kurt_Bremser
Super User

Just make sure there's no blank between the macro variable name and the dot:

%let Feuille = Villes et rues;

proc export
  data=sashelp.class
  file="/folders/myfolders/class.xlsx"
  dbms=xlsx
  replace
;
sheet="&Feuille.";
run;
SASdevAnneMarie
Barite | Level 11
Thank you, Kurt !

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
  • 3 replies
  • 2218 views
  • 1 like
  • 3 in conversation