%let path='c:/users/sourabh/' ;
%let file='online.csv' ;
%let want=%str(%')%sysfunc(dequote(&path))%sysfunc(dequote(&file))%str(%');
%put &want ;
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.
%let path='c:/users/sourabh/' ;
%let file='online.csv' ;
%let want=%str(%')%sysfunc(dequote(&path))%sysfunc(dequote(&file))%str(%');
%put &want ;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.