Still think there may be something on your end.
I run this, where I have taken the time to actually provide data sets:
data table_A ;
input ID;
datalines;
1
2
3
4
;
data table_B ;
input ID ;
datalines;
2
4
9
;
data table_C;
input ID;
datalines;
2
3
8
;
proc sql;
create table all_ids as select
distinct coalesce(a.ID,b.ID,c.ID) as all_ID,
(case when calculated all_ID=a.ID then 1 else 0 end) as in_A,
(case when calculated all_ID=b.ID then 1 else 0 end) as in_B,
(case when calculated all_ID=c.ID then 1 else 0 end) as in_C
from table_A as a full join table_B as b on a.ID=b.ID full join table_c as c on a.ID=c.ID;
quit;
And get this result:
Obs all_ID in_A in_B in_C
1 1 1 0 0
2 2 1 1 1
3 3 1 0 1
4 4 1 1 0
5 8 0 0 1
6 9 0 1 0
If you aren't then one (or possibly more) of your data sets is not as you present it.
... View more