Hi, I'm using SAS 9.4 and I'd like to use the above code but filter out (in some way) a specific list of SUBNUM from each table. i.e. the SUBNUM list (below, right now about 8, but up to about 15) are the only SUBNUM I want in each tab, but I'd like all records for each SUBNUM in the list. The SUBNUM variable is in every dataset. Not all datasets will have records for each SUBNUM from the list, and some tables will have more than one record per SUBNUM from the list. Thank you so much for your help.
libname ABC 'X:\Folder\SASData';
data _null_;
call symputx('datestamp', put(date(), YYMMDDN.));
run;
libname XL xlsx "%sysfunc(pathname(WORK)) \..\..\..\..\..\Filename Output &datestamp..xlsx";
run;
proc copy inlib=ABC outlib=XL mt=data;
run;
Example data from one dataset that I want to filter for SUBNUM '123' and '345':
Column1 | SUBNUM | Column2 | Column3 |
data | 123 | data | data |
data | 345 | data | data |
data | 789 | data | data |
data | 111 | data | data |
data | 123 | data | data |
data | 789 | data | data |
data | 123 | data | data |