title: sas programming: loop over a macro call
body: <p>I am new to sas and have the following macro call:<br>
  %test (input1=&amp;lib._2015, input2=&amp;lib.base, out=out_data_2016)</p>
  
  <p>Now, I want a loop that in the next step the output_data_2016 are used as input1 and create a new out variable out_data_2017. The call then should look like:<br>
  %test (input1=out_data_2016, input2=&amp;lib.base, out_data_2017).</p>
  
  <p>Thanks in advance!</p>
  
  <p>edit:<br>
  I have several years to observe (say 2010 till 2018). Then I need 9 macro calls:</p>
  
  <p><code>%test (input1=&amp;lib._2014, input2=&amp;lib.base, out=out_data_2015)
  %test (input1=&amp;lib._2015, input2=&amp;lib.base, out=out_data_2016)
  %test (input1=out_data_2016, input2=&amp;lib.base, out_data_2017)</code> etc.</p>
  
  <p>My hope is to create a loop, so that I need only one step, but I do not know why...</p>