set GEN.TRANSACT_BASE_201909 - GEN.TRANSACT_BASE_202308;
SAS thinks that this list of data set names goes from integer 201909 to integer 202308, and so what integer comes after 201912? Why 201913, of course, and this data set does not exist. SAS does not know that this is a list of months where 201913 is impossible.
You probably could create a list of data set names in library GEN that actually exist, via a macro variable. In this case, we query the dictionary tables to find out what data sets actually exist in GEN, and store the results in a macro variable &DSNAMES
/* UNTESTED CODE */
proc sql noprint;
select distinct cats('gen.',memname) into :dsnames separated by ' ' from dictionary.tables
where libname='GEN' and input(substr(memname,15),6.) between 201909 and 202308;
quit;
and then use
set &dsnames;
... View more