You can make a macro variable to hold them all together. data temp;
do i=2011 to year(today())-1;
do j=1,2;
tname=cats('work.ABC_',i,'H',j);output;
end;
end;
if month(today()) lt 7 then do;tname=cats('work.ABC_',year(today()),'H1');output;end;
else do;
tname=cats('work.ABC_',year(today()),'H1');output;
tname=cats('work.ABC_',year(today()),'H2');output;
end;
drop i j;
run;
proc sql noprint;
select catx(' ','select * from',tname) into : list separated by ' union all '
from temp;
create view xxxx as
&list ;
quit;
%put &list ;
Xia Keshan
... View more