Figure out what the name is.
Then you can use it to generate the RENAME=() dataset option.
For example say you want to combine the observations from three datasets in the WORK libref . So generate a SET statement that looks like:
set a(rename=(a=column1)) b(rename=(b=column1)) c(rename=(c=column1)) ;
Code:
%let libref=work;
%let dslist=a b c ;
proc sql noprint;
select cats(libname,'.',memname,'(rename=(',name,'=','column1','))')
into :code separated by ' '
from dictionary.columns
where libname=%upcase("&libref")
and findw("&dslist",memname,,'sir')
and varnum=1
and lowcase(name) ne 'column1'
;
quit;
data want;
set &code ;
run;
PS Can you explain how you got into this situation? Perhaps you can fix the problem earlier in the process and avoid the need to generate RENAME= dataset options.