I have saved all my dataset in one library and then using sashelp.vstable I am able to find dataset name.
Using dataset name, I try to find out the month and year.
Finaly I create a macro variable qtr_dsn that would store all the dataset name for quarter=3 and year =2017.
libname month "/folders/myfolders";
data month.Case_072017;
dt='01Jul2017'd;
run;
data month.Case_082017;
dt='01Aug2017'd;
run;
data month.Case_092017;
dt='01Sep2017'd;
run;
proc sql;
create table dataset_nm
as select memname
from sashelp.vstable
where libname='MONTH';
quit;
DATA TEMP;
SET dataset_nm;
month=input(SUBSTR(memname,6,2),8.);
year=input(SUBSTR(memname,8,4),8.);
if month in (1,2,3) then qtr =1;
if month in (4,5,6) then qtr =2;
if month in (7,8,9) then qtr =3;
if month in (10,11,12) then qtr =4;
RUN;
proc sql;
select memname into :qtr_dsn separated by " "
from temp
where qtr=3 and year =2017;
quit;
%put &qtr_dsn;
data dsn_qtr3;
set &qtr_dsn;
run;
... View more