1

我在调试以下问题时遇到了麻烦proc sql

%local datasetCount;
%let datasetCount = 0;

proc sql;
            select count(*)
            from path.dataset_list
            into: &datasetCount.;  * I also tried into: datasetCount;
quit;

我的语法错误是什么?我得到以下信息

ERROR 22-322: Syntax error, expecting one of the following: ;, ',', ANSIMISS, CROSS, EXCEPT, FULL,
              GROUP, HAVING, INNER, INTERSECT, JOIN, LEFT, NATURAL, NOMISS, ORDER, OUTER, RIGHT,
              UNION, WHERE.

ERROR 76-322: Syntax error, statement will be ignored.
4

1 回答 1

2

你的订单是错误的。仅当 &datasetcount 是包含要存储到的变量名称的宏变量的名称时(可能不是),才需要使用&符号。

proc sql;
select count(1) into :datasetcount from path.dataset_list;
quit;
于 2013-08-06T03:10:20.960 回答