0
我试图做宏如下:误差与报价,同时通过宏观变量PROC SQL
proc sql;
select * from table1 where col1 like 'x%'
quit;
%macro temp(val=x);
proc sql;
select * from table1 where col1 like '&val%'
quit;
%mend;
的问题是要解决val的值,它必须是在双引号(”“ ),但是sql语句只能使用单引号(''),因为它会用双引号引起错误:无效的列名称。
任何建议如何解决这个问题?
使用双引号直接表达的proc sql语句不起作用:像select * from table1其中col1类似于“x%”或infact col1 =“x”,所有引发同样的错误:列名称无效。 – user2542275
请看看类似的问题:http://stackoverflow.com/questions/27288623/sas-proc-sql-inside-macro – yukclam9
请检查编辑答案 – yukclam9