A data step with hash table lookups would likely perform best as long as you've got enough memory for the hash tables.
Below code that combines everything into a single SQL. This will still require implicit sorting for the joins. The main difference to your code is the union ALL and combining the data prior to the inner join - which avoids multiple sorts of table a.
Without the ALL keyword the union will dedup the result set which requires sorting. If you can be sure that you don't have overlaps in your tables b and c then such a dedup is not required.
proc sql;
create table want as
select
l.record,
l.type,
r.treat
from
a l
inner join
(
select record, treat
from b
union all
select record, treat
from c
) r
on l.record=r.record
;
quit;
... View more