A macro would be a good way to handle this. Put your query into the macro and then just run it 11 times, each time with a new dataset name. In the example below, each loop of the macro creates a tmpfile which is then appended to a master outfile. The tmpfile is then deleted to prepare for the next macro invocation.
Example:
[pre]
%macro runquery (infile=, outfile=);
proc sql;
create tmpfile as
select col1, col3, col5
from &infile;
quit;
proc append base=&outfile data=tmpfile;
run;
proc datasets library=work nolist;
delete tmpfile;
run;
quit;
%mend runquery;
%runquery (infile=work.table1, outfile=work.endtable);
%runquery (infile=work.table2, outfile=work.endtable);
.
.
.
%runquery (infile=work.table11, outfile=work.endtable);
[/pre]