Try this way ..
%Macro test(libname=,prefix=,newvar=);
/**listing the data from a particular library where the actual data resides and by giving proper condition**/
proc sql;
create table listData as
select memname
from dictionary.tables
where libname="&libname" and memname like "&prefix%" ;/*here prefix or suffix how you are identifying data set*/
quit;
/**Count of total no.of data sets **/
proc sql;
select count(*) into :cnt from listData;
quit;
/**create macro variables for each data set..lets say in your case it is 36**/
/**like memname1=12012 memname2=22012......memname36=122014**/
proc sql;
%do i=1 to &cnt.;
select memname into :memname&i.-memname&cnt. from listData;
%end;
quit;
/** calling one by one using do loop and create the required new varibles**/
%macro all;
%do i=1 to &cnt.;
%let memname=%sysfunc(compress(&&memname&i.)
data new_&memname.;
set &memname.;
/*sort */
&newvar=;/*apply logic here if this is common for all*/
run;
%end;
%mend;
%all;
%mend;
/*invoke the macro by giving your library name and prefix or suffix*/
%test(libname=,prefix=,newvar=);
... View more