title: looping over character values in SAS
body: <p>In Stata you can loop over a list of character values with the <a href="http://www.stata.com/help.cgi?foreach" rel="nofollow">foreach command</a>. I've been trying to do the same in SAS to no avail so far. I'm trying to run a series of data and proc statements over all the values of character column. I tried with the following:</p>
  
  <pre><code>%let mylist = a b c; * These are all the values of a column called "code";
  
  data mydata_@mylist; * Each element creates a new table;       
     set mydata;   
     where code=&amp;mylist; 
     run;
  </code></pre>
  
  <p>What am I doing wrong or missing?</p>
  
  <p>Thanks in advance,</p>
  
  <p>Matías</p>