@Yona22
Below fully working and tested code using your table names.
/* create sample source tables */
%macro doit();
data _null_;
length source_dslist $2000;
do year=0 to 20;
do month=1 to 12;
source_dslist=catx(' ',source_dslist, cats('tab', put(year,z2.),put(month,z2.)));
end;
end;
call symputx('source_dslist', source_dslist);
stop;
run;
%mend;
%doit();
data &source_dslist tab0203_copy tab0215;
set sashelp.class(obs=2);
run;
/* create list of source tables within desired date range.
and store result in macro variable &dslist
*/
%let dslist=;
proc sql noprint;
select cats(libname,'.',memname) into :dslist separated by ' '
from dictionary.tables
where libname='WORK' and substr(memname,1,3)='TAB'
and input(compress(memname,,'kd'),yymmn4.) between '01mar2002'd and '01dec2019'd
order by memname
;
quit;
%put &=dslist;
/* combine all source tables */
data want;
length _inds $41;
format payment_date yymmn4.;
set &dslist indsname=_inds;
payment_date=input(compress(_inds,,'kd'),yymmn4.);
run;
proc print data=want(obs=2);
run;