一般需要考虑如果更新数据中不包括所有key值:
proc sql noprint;
create table ccc as
select a.x,a.z, coalesce(b.y,a.y) as y from aaa as a left join bbb as b
on a.x = b.x;
quit;
或者:
proc sql;
update aaa
set y = (select y from bbb where aaa.x = bbb.x)
where x in (select x from bbb)
;quit;