Hello, When I do two times the same left join including a sum, I get slightly different output datasets. Differences of smnt of max E-8 for numbers in thousands. proc sql;
create table tab3_time1 as
select
t1.num_dman_finm,
sum(t2.mnt) as smnt
from local.tab1 as t1
left join local.tab2 as t2
on t1.num_dman_finm = t2.num_dman_finm
and t1.num_pers_dfe = t2.num_pers_dfe
group by t1.num_dman_finm
order by t1.num_dman_finm
;
quit;
proc sql;
create table tab3_time2 as
select
t1.num_dman_finm,
sum(t2.mnt) as smnt
from local.tab1 as t1
left join local.tab2 as t2
on t1.num_dman_finm = t2.num_dman_finm
and t1.num_pers_dfe = t2.num_pers_dfe
group by t1.num_dman_finm
order by t1.num_dman_finm
;
quit;
proc compare data=tab3_time1 compare=tab3_time2;
run; The above proc sql are identical, except for the output name. tab1 contains only num_dman_finm and num_pers_dfe . Without duplicates. tab2 contains num_dman_finm , num_pers_dfe and mnt . With key duplicates. num_dman_finm and num_pers_dfe are integer keys. mnt are moneys amounts, with 2 decimals. Shouldn't the same request produce the same output? There are ~5000 differences in the output datasets of ~900 000. Working on version 9.04.
... View more