我需要在 Teradata DBMS 中将小表与大表连接起来。我将 small.A、B、C、D 4 列选择为宏变量,但问题是变量经常会超过缓冲区大小。所以,我用谷歌搜索了下面的代码(http://support.sas.com/techsup/technote/ts553.html ),即每 105 条记录按块运行 SQL。现在我有两个问题: 1. "file temp;" 行 似乎不适合我。错误是:错误:访问/x/sas/config/Lev1/SASApp/temp.dat 的权限不足。2.该示例只有一列要加入,而我有 4 列 AD 要加入。有人可以帮帮我吗?我感谢您的帮助!
%let 块=105;
proc sql;
create view uniq as
select unique key
from small
order by key;
data _null_;
file temp;
set uniq end=end;
if _n_ = 1 then do;
put "create table result as"
/ " select key,data"
/ " from connection to dbms"
/ " (select key,data"
/ " from large where key in("
/ key;
end;
else if mod(_n_, &chunk) = 0
and not end then do;
put "));" //;
put "insert into result"
/ " select key, data"
/ " from connection to dbms"
/ "(select key,data"
/ "from large where key in("
/ key;
end;
else if end then do;
put key "));" //;
end;
else put key ",";
run;
proc sql;
connect to <DBMS> as dbms;
%inc temp;