You have to join Results and Reference tables. I'm suggesting to use proc SQL for joining because there is two joins and tables doesn't have common variable.
data results;
input ID resultA resultB;
datalines;
1 2392 887
2 1587 902
3 2392 234
4 4035 2392
;
run;
data reference;
input num first $ last $;
datalines;
2392 joe bloggs
4035 mary smith
1587 bloggs joe
234 sherlock holmes
902 john watson
887 benjamin button
;
run;
proc sql;
create table want as
select R.ID,
Catx('-',r1.First,r1.Last) as First,
Catx('-',r2.First,r2.Last) as Second
from Results R
left join Reference R1
on r.ResultA = r1.num
left join Reference R2
on r.ResultB = r2.num
order by r.ID;
quit;
... View more