在干净的会话中本地执行:
%let x = %str(put(age, best.));
proc sql;
select &x from sashelp.class;
quit;
这会产生以下错误:
1 put(age, best.)
----
22
----
76
ERROR 22-322: Syntax error, expecting one of the following: a format name, ?.
ERROR 76-322: Syntax error, statement will be ignored.
但是这个“手动解决”的版本运行时没有注释、警告或错误:
proc sql;
select put(age, best.) from sashelp.class;
quit;
有人能准确解释一下 %str() 在这个程序中做了什么导致执行时出现问题吗?为这个模糊的问题道歉,但我不确定相关的互动是什么;我无法使用等效的数据步骤语法进行复制,因此可能涉及 proc SQL 特性?