All:在执行IN运算符以匹配宏字符串中的单词时,需要使用引号。但是,结果很沮丧,会不会有人提醒我我错过了什么。此宏字符串由proc创建,如下所示
proc sql noprint;
select memname into :domains separated by ' '
from sashelp.vtable
where libname='SDTM';
quit;‘接下来,我用这个语句引用了字符串
%let domains_quoted = %nrbquote(')%qsysfunc(prxchange(s/\s+/%nrbquote(',')/oi,-1,&domains))%nrbquote(');在日志中,它没有显示任何问题
SYMBOLGEN: Macro variable DOMAINS_QUOTED resolves to 'AE','CM','DM','DS','EG','EX',...然后,我希望我能够过滤输出数据集。“”“
data want;
set have;
if dname in (&domains_quoted);
run;“”我收到一条错误信息,上面写着:
SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing.
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant,
a missing value, iterator, (.有人会提醒我在这些步骤中错过了什么吗?非常感谢。
发布于 2022-09-12 22:02:32
使用PRX ()函数来避免PRX步骤。
proc sql noprint;
select quote(memname) into :domains separated by ' '
from sashelp.vtable
where libname='SDTM';
quit;
data want;
set have;
if dname in (&domains_quoted);
run;https://stackoverflow.com/questions/73695659
复制相似问题