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 ;

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