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 ;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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