【发布时间】:2014-10-05 01:37:37
【问题描述】:
我需要在 Teradata DBMS 中将小表与大表连接起来。我将 small.A、B、C、D 4 列选择为宏变量,但问题是变量经常会超过缓冲区大小。 所以,我用谷歌搜索了代码(http://support.sas.com/techsup/technote/ts553.html ) 下面是按块运行 SQL,比如每 105 条记录。现在我有两个问题: 1. 行“文件温度;”似乎不适合我。错误是: 错误:访问 /x/sas/config/Lev1/SASApp/temp.dat 的授权不足。 2. 该示例只有一列要加入,而我有 4 列 A-D 要加入。 有人可以帮帮我吗?感谢您的帮助!
%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;
【问题讨论】:
标签: variables macros sas proc-sql