Hello Experts,
I would like to join the rows with only the b.IS_KEY that are not in table a, how to rewrite this code :
proc sql;
create table Tab_complet as select a.*, b.* from Tab2
left join HISTO as b on a.NO_1 =b.NO_1 and
a.IS_key=b.IS_key and a.D_VAL=b.D_VAL;
quit;
I would like to add to the table a the missing IS_key from table b, or, with proc sort, I would like to do this :
data tab_complet;
merge Tab2(in=IN1) HISTO(in=IN2);
by NO_1 IS_key D_VAL;
if NO_1 (IN1=1 and IN2=1) and IS_key (IN1=0 and IN2=1) and D_VAL (IN1=1 and IN2=1);
run;
I other words, I would like to merge tab1+tab2 by X1 not eq X2 and X3 to have the result the tab3 :
data tab1;
input X1 X2 X3;
cards;
1 3 8
2 3 7
3 4 6
4 5 7
;
run;
data tab2;
input X1 X2 X3;
cards;
1 3 8
2 5 7
3 6 7
4 5 7
;
run;
data tab3;
input X1 X2 X3;
cards;
1 3 8
2 3 7
2 5 7
3 4 6
4 5 7
;
run;
... View more