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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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