BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sourabhy
Calcite | Level 5
i have two macro vatiable as below
%let path='c:/users/sourabh/'
%let file='online.csv'
i need
'c:/users/sourabh/online.csv'
kindly suggest how can i achieve dat
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
%let path='c:/users/sourabh/' ;
%let file='online.csv' ;

%let want=%str(%')%sysfunc(dequote(&path))%sysfunc(dequote(&file))%str(%');

%put &want ;

View solution in original post

2 REPLIES 2
Kurt_Bremser
Super User

Start by not putting quotes into macro variables, and it is very easy:

%let path=c:/users/sourabh/;
%let file=online.csv;

%let want=&path.&file.;

Only use (double) quotes where you use the macro variable, eg in a filename statement.

Ksharp
Super User
%let path='c:/users/sourabh/' ;
%let file='online.csv' ;

%let want=%str(%')%sysfunc(dequote(&path))%sysfunc(dequote(&file))%str(%');

%put &want ;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

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
  • 1077 views
  • 2 likes
  • 3 in conversation