My question is that: I want to merge 3 tables in proc sql
1) The first code is:
proc sql noprint;
Create table want_1 as
select a.*, b.x
from Have_1 as a
left join
Have_2 as b on
a.column- var = b.column- var;
quit;
proc sql noprint;
Create table want_2 as
select a.*, b.y
from want_1 as a
left join
Have_3 as b on
a.column - var = b.column - var;
quit;
I'm merging first two datasets, then with this output I merged with the third one
2) The second code is: (where I merged three dataset in a single query)
proc sql;
create table Combo as
select a.*, b.x, c.y
from Have_1 as a, Have_2 as b, Have_3 as c
where a.column-var= b.column-var and b.column-var = c.column-var;
quit;
when i run 2 codes i got the outputs, but the only difference is i got variation in the observation count.
The first code shows more observation compared to the second one.
can anyone check anything wrong in my both the codes??
why the variation has occurred?
which one is correct?
TIA