title: Dynamically call macro from sas data step
body: <p>This code executes fine when Run as a SAS program:</p>
  
  <p><code>%MyMacro(foo_val, bar_val, bat_val);</code></p>
  
  <p>I have created a table using:</p>
  
  <pre><code>DATA analyses;
     input title : $32. weight : $32. response : $32.;
     datalines;
  foo1 bar1 bat1
  foo2 bar2 bat2
  ;
  </code></pre>
  
  <p>I want to execute <code>MyMacro</code> once for each row of the <code>analyses</code> table.</p>
  
  <p>The following code appears to only pass the string values <code>title</code>, <code>weight</code> and <code>response</code> (rather than the data values <code>foo1</code> etc.) to my macro (tested with calls to the <code>%put</code> command) : </p>
  
  <pre><code>DATA _NULL_ ;
      set analyses;
      %MyMacro(title, weight, response);
  
  RUN;
  </code></pre>
  
  <p>How can I invoke the macro once per record of the <code>analyses</code> table whilst passing data values as arguments to the macro? The intention is to actually run this for a very large number of analyses so the solution must scale appropriately to many more records in the <code>analyses</code> table.</p>