why this marco doesn't work:
%macro t(var=);
proc sql;
select name into: name from sashelp.class where name='&var.';
quit;
%put _user_;
%mend;
%t(var=Henry);
what is wrong with my single quotation mark?
Macro language references are not expanded when enclosed in single quote marks. Use double quote character instead.
name = "&var"
Macro language references are not expanded when enclosed in single quote marks. Use double quote character instead.
name = "&var"
is this the only main difference when choosing to use single or double quotation?
I always thought single/double quotation can be used interchangeably.
Good topic for a SUG paper. Their differences seem to be more than just that. Especially when you refer Windows path ( X command, etc) or using SQL pass-thru ( well, to be fair, that is NOT a difference within SAS).
Haikuo
Is it safe to say that double quote is more generic than single quote in passing macro variables?
Here is a nice write up in the on line documentation.
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a001071889.htm
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.