Your code sample indicates that the libraries are already assigned so below just for fun another coding option which could be useful in case you need access to different monthly tables.
/* create sample data */
filename codegen temp;
data _null_;
file codegen;
/* file print;*/
put 'options dlcreatedir;';
do i=1 to 7;
put
'%let lr=in' i ';' /
'libname &lr "%sysfunc(pathname(work))/&lr";' /
'data &lr..vapp22' i z2. ';' /
' var="&lr";'/
'run;'
;
end;
run;
%include codegen /source2;
/* create blank separated list of all source librefs in scope */
%let lrefs=;
proc sql noprint;
select distinct libname into :lrefs separated by ' '
from dictionary.libnames
where prxmatch('/^IN\d+$/',strip(libname))>0
;
quit;
/* create concatenated library using all source librefs in scope */
libname in_all (&lrefs);
/* read one set of monthly source tables */
data work.want;
set in_all.vapp22:;
run;
If the source libraries aren't already assigned then it wouldn't be hard to generate the concatenated library directly by generating the physical paths.
... View more