It should not matter. All database (and SAS) have a thing called metadata. This is information about the database stored in a dataset itself so that you can use it. For instance in SAS you have sashelp.vtable and vcolumn, which will tell you what datasets appear in what libraries and what column information they have. The same can be done in SQL with dictionary.tables and columns. Within this information you know what is present. Say for instance I have a load of datasets with dates suffix in library xyz and I want those from 2018 (yymmdd format):
data _null_;
set sashelp.vtable (where=(libname="XYZ" and index(memname,"2018"))) end=last;
if _n_=1 then call execute('data want; set ');
call execute(" "||memname);
if last then call execute(';run;');
run;
This will from the metadata return all rows which fulfill the criteria of being in XYZ, and having 2018 as part of the dataset name. From that we use code generation to create a datastep which sets all these together.
So in your database, there will be a table which tells you which databases have been created and you can use that list.
... View more