Are you familiar with the macro language? Are you looking at examples of macros that use %DO loops to loop over files?
If so, a key point is that a macro %DO loop that iterates over a list does not know if the list is a list of files, or directories, or elephants. There are no 'objects' in the macro language. Everything is just text. So the list is literally just a list of words.
If you have an example you understand which is using the macro language to loop over a list of files, you could try revising it to loop over a list of libraries. Once you have a good understanding of macro looping, then you can loop over anything, because every list is just a list of words. Here's one way to loop over a space-delimited list:
%macro try(list=) ;
%local i item ;
%do i=1 %to %sysfunc(countw(&list,%str( ))) ;
%let item=%scan(&list,&i,%str( )) ;
%put item &i: &item ;
/**
*here you could write any SAS code to execute for each item ;
libname mylib "c:\&item" ;
data want ;
set mylib.mydata ;
run ;
proc append base=wantall data=want ;
run ;
*this could also be a macro call e.g. : ;
%extract(folder=&item)
**/
%end ;
%mend try ;
%try(list=aaa bbb ccc)
... View more