I'm trying to output the growth percentage from one year to the next. For ease of showing, I've condensed the data to this: data new; infile datalines dlm=',' dsd; input year $ gr_count ug_count @@; datalines; "2008",5045,7420 "2009",5500,7837 "2010",5696,8481 "2011",5708,9010 "2012",5725,9443 ; run; What I would like the report to look like (as close as possible) is this: ---- 9.02 3.56 0.21 0.30 3.27 2008 2009 2010 2011 2012 avg (gr_count percent change from previous year and overall average of all years) ( change = ( (2009-gr_count-# - 2008-gr_count-#) / (2008-gr_count-#) )* 100 ) ( 9.02 = ( (5500-5045)/5045 ) * 100 ) rounded to two decimal places ) ( avg = percentages summed and divided by number of percentages ) The actual data has year and class, and has 12,465 total records for year 2008 (with 5,045 where class = 'gr' and 7,420 where class = 'ug', 13,337 total records for 2009, etc., and there are other fields that for which I will need to calculate the growth (in different outputs). I'd love to program SAS to do this calculation for me, but I've been working with SAS for about 2 months now, and I've been teaching myself as I go - so I have never encountered anything like this and I can't find a resource that will tell me how to do exactly this. Thank you.
... View more