变量部门在数据步骤中具有M& S值
set ttt;
DepartmentComp=Compress(DepartmentComp);*For use in making directories;
CALL SYMPUT('ggg',trim((division)));
CALL SYMPUT('fff',trim((Department)))
显示日志 SYMBOLGEN:宏变量FFF解析为M& S 警告:未解析明显的符号引用S.
如果我怀疑它会影响程序,我如何摆脱警告?
答案 0 :(得分:1)
使用%superq()
屏蔽'&'并防止解决''。以下是您的一个例子:
60 data test;
61 comp = "%superq(fff)";
62 putlog "NOTE: comp=%superq(fff)";
63 run;
NOTE: comp=M&S
NOTE: The data set WORK.TEST has 1 observations and 1 variables.
答案 1 :(得分:1)
如果您在后续datastep中使用这些变量,则可以使用symget来避免过早尝试解析(如下所示):
data _null_;
division='%myDiv';
department='Food&Drink';
call symputx('ggg',division);
call symputx('fff',department);
run;
data someds;
division=symget('ggg');
department=symget('fff');
putlog division= department=;
run;
注意事项: