Search code examples
sas-macro

SAS macro which will apply means and univariate procedure on each year for revenue variable


Let’s say we have "Revenue" information for different years from 2005 to 2009 with variable revenue. I want to write a sas macro that applies means and univariate procedure on each year for revenue variable. I want some clues how to work around this as am clueless how to proceed. Any help would be appreciable. Thank you in advance!!


Solution

  • Although you've tagged this question with 'sas-macro', this doesn't necessarily need any macro code. In general, any of the PROCs take a BY statement, so you would just run a

    proc means data=revenue;
      by year;
      ... more statements...
    run;
    

    Start with a few of the examples from http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146738.htm and see how you get on.