title: How to write a macro code to input daily SAS datasets to append them into annual datasets?
body: <p>I have daily SAS dataset named with the following format, for example for 01/01/2012 and 01/02/2012:</p>
  
  <p>daily_01jan12 and daily_02jan12</p>
  
  <p>I will have to append all these datasets into an annual data set. 
  What is an efficient way of writing this code using macro in SAS? </p>
  
  <p>What I have right now is below. However, I would need to do it 365 times, and I am sure there must be a better way. </p>
  
  <p>Any help would be greatly appreciated. Thank you.</p>
  
  <pre><code>data libw.daily01Jan2012;
  set libw.daily_01Jan2012;
  Day=1;
  Month=1;
  Year=2012;
  
  data libw.daily02Jan2012;
  set libw.daily_02Jan2012;
  Day=2;
  Month=1;
  Year=2012;
  
  proc append base=libw.daily01Jan2012 data=libw.daily02Jan2012;
  run;
  </code></pre>