You need to provide a lot more detail about what you have and what you are trying to do.
The NATURAL JOIN syntax in PROC SQL will autodetect matching variable names and use those as keys when joining datasets.
proc sql;
create table want as
select *
from a natural join b
;
quit;
SAS Innovate 2025: Register Today!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.