proc sql;
select coalesce ( A.match, B.match) as match, A.improve as DrugA_IMP, B.improve as DrugB_IMP
from (select Match, Improve
from sasuser.mood
where type=1)
as A
full join
(select Match,Improve
from sasuser.mood
where type=2)
as B
on A.match=B.match;
quit;