1# redaring
Here is a simple one sql. Note there is no guarantee of ordering of SQL return values without an 'order by'.
Hope this helps.
data a;
input Id x y z;
cards;
111 61 70 55
111 50 33 26
132 56 78 36
132 90 84 56
132 59 43 78
253 44 96 86
145 99 40 73
145 100 69 77
;
data b;
input Id aa bb cc;
cards;
111 5.23 3.44 0.45
132 3.02 4.78 9.40
145 6.32 2.85 5.66
;
proc sql;
create table tmp as
select coalesce(a.Id, b.Id) as Id, b.aa, b.bb, b.cc, a.x, a.y, a.z
from b as b
full join A as a on A.ID = b.ID
;
quit;
proc print data=tmp; run;