The following is one solution to the problem that uses the dictionary tables and a macro variable to pass the list of existing datasets to the datastep that combines the datasets.
simple example data to use to illustrate solution
use sas dictionary tables to find out the
names of the datasets that actually exist
in the library.
Then use the ability to generate a macro variable
containing a list of values separated by blanks
create table tablenames as
select memname INTO :setlist SEPARATED BY ' '
see what the value of the macro variable is
use the macro variable which gets replaced by
the list of datasets
The OP must be using SAS 9.2 because of the SET statement and using the hyphen for a consecutive file-range specification.
Additionally, some other options are using the OPTIONS setting NODSNFERR to convert the error to a warning message. And, with SAS 9.2, the file-prefix in the SET statement can be used with a trailing colon character.