以下在SAS执行可以 :
proc sql noprint;
select count(distinct ID2) into :nID2
from dataset2
;
quit;
但是 以下为什么不行 :(sql server连接没问题 )
proc sql noprint;
connect to odbc as sqlserver1(user=liming pw=12345 dsn=codea);
select count(distinct ID) into :num_ID
from connection to sqlserver1(
select
ID
from dataset1
)
;
quit;
多谢!
问题补充 :SAS如何在sql server用以上方法(into ) 创建 宏变量 ??