I use SAS E.G. version 4.3. There are datasets (in a folder called archive) where the names are something like this: "table_contents_[year]", where [year] = 2012, 2013, 2014, ... For example: table_contents_2012, table_contents_2013, ..., table_contents_2016. One of the variables of these datasets is a date variable that contains dates for that certain year. I want to put the data from these datasets into one new dataset, but selecting only data as from a certain year or a certain date. How can I do this? With the statement below, I can extract and put the data from ALL datasets with name "tablecontents_[year]" into a new dataset. But I don't know how I can select data that are for example greater than or equal to year 2015 or 10SEP2015? %let listOfDataTables =;
proc sql noprint;
select compress("arch." || memname)
into :listOfDataTables separated by ' '
from sashelp.vtable
where libname=upcase("arch") and upcase(memname) like 'tablecontents*_%' escape '*';
quit;
... View more