If you are the one who is creating these monthly data sets then be nice to your data consumers and create views for them for the most often required windows like "current month", "current quarter", "last quarter" and so on - and update (re-create) these views whenever you create a new monthly data set.
If you are one of the data consumers then I'd request such views as that's really not hard to code and implement.
Below some code which should give you what you have been asking for.
data sales201512 sales201601 sales201602;
product_id=1; output;
product_id=2; output;
run;
%macro create_view
(
view_name=,
base_name=,
start_yyyymm=,
n_months=
);
proc sql;
create view &view_name as
%do i=0 %to %eval(&n_months-1);
select *
from &base_name%sysfunc(intnx(month, %sysfunc(inputn(&start_yyyymm, yymmn6.)), &i), yymmn6.)
%if &i ne %eval(&n_months-1) %then
%do;
union all
%end;
%end;
;
quit;
%mend;
%create_view
(
view_name=v_3months,
base_name=sales,
start_yyyymm=201312,
n_months=3
);
data test;
set v_3months;
where product_id=1;
run;
proc print data=v_3months;
where product_id=2;
run;
... View more