title: How to loop over a proc in SAS?
body: <p>I would like to "automate" PROC calls in SAS using lists and loops. For example I would like to call PROC EXPORT with a list of calculation result tables such as:</p>
  
  <pre><code>do over (tables=FitStatistics Type3_Tests LSM Diff) ;
     PROC EXPORT DATA= WORK.tables
     OUTFILE="file.xls"
     DBMS=EXCEL REPLACE;
     SHEET=tables;
     RUN;
  loop;
  </code></pre>
  
  <p>This should create a "file.xls" and insert a sheet for each table in "tables". I know that this should work with macros somehow, but couldn't figure the correct syntax.</p>