ERROR: File XXXX is sequential. This task requires reading observations in a random order, but the engine allows only sequential access
ERROR: File XXXX is sequential. This task requires reading observations in a random order, but the engine allows only sequential access
我正在尝试更新 oracle table。
我在 运行 以下数据步骤时遇到此错误:
data oracle.have(drop=_:);
modify oracle.have end=last;
if _n_=1 then do;
declare hash h1(dataset:'_update');
declare hiter hh1('h1');
_rc = h1.defineKey('id','tid','valid_to');
_rc = h1.defineData('valid_from');
_rc = h1.defineDone();
end;
if h1.find()=0 then do;
replace;
_rc = h1.remove();
end;
run;
ERROR: File ORACLE.HAVE.DATA is sequential.
This task requires reading observations in a random order, but the
engine allows only sequential access.
有什么方法可以绕过这个错误吗?
显然,修改语句仅适用于 SAS 数据集。
我使用的解决方法如下:
proc sql;
update have t1
set valid_from = (select valid_from from _update t2
where t1.id = t2.id
and t1.tid = t2.tid
and t1.valid_to = t2.valid_to
and t2.dim="FROM")
where catx('#',id, tid, valid_to) in (select catx('#',id, tid, valid_to)
from _update t3
where t3.dim="FROM");
quit;
我正在尝试更新 oracle table。
我在 运行 以下数据步骤时遇到此错误:
data oracle.have(drop=_:);
modify oracle.have end=last;
if _n_=1 then do;
declare hash h1(dataset:'_update');
declare hiter hh1('h1');
_rc = h1.defineKey('id','tid','valid_to');
_rc = h1.defineData('valid_from');
_rc = h1.defineDone();
end;
if h1.find()=0 then do;
replace;
_rc = h1.remove();
end;
run;
ERROR: File ORACLE.HAVE.DATA is sequential. This task requires reading observations in a random order, but the engine allows only sequential access.
有什么方法可以绕过这个错误吗?
显然,修改语句仅适用于 SAS 数据集。
我使用的解决方法如下:
proc sql;
update have t1
set valid_from = (select valid_from from _update t2
where t1.id = t2.id
and t1.tid = t2.tid
and t1.valid_to = t2.valid_to
and t2.dim="FROM")
where catx('#',id, tid, valid_to) in (select catx('#',id, tid, valid_to)
from _update t3
where t3.dim="FROM");
quit;