I am assuming you will want one row data set with ypur named variables. data x; informat one two three four five comma12.; input year one two three four five ; datalines; 2005 36,565,000 38,964,000 43,091,000 41,709,000 64,508,000 2006 36,761,000 39,090,000 42,869,000 42,619,000 66,213,000 2007 37,282,000 39,514,000 42,582,000 43,291,000 67,981,000 2008 37,342,000 39,707,000 41,966,000 43,723,000 69,878,000 2009 37,422,000 39,717,000 41,866,000 43,733,000 69,888,000 2010 37,501,000 39,727,000 41,766,000 43,743,000 69,898,000 2011 37,468,000 39,737,000 41,666,000 43,753,000 69,978,000 ; run; data want; array y [2004:2010] y2004-y2010; do until(last); set x end=last; upperlimit = MIN(2010,Year); do yr = 2004 to UpperLimit; y[yr]+((.1)*(one + two + three + four + five)*(year > yr and year <= (yr+6))); end; end; put (y2004-y2010)(=); keep y2004-y2010; run; y2004=138091600 y2005=138868100 y2006=116112900 y2007=93047900 y2008=69786300 y2009=46523700 y2010=23260200
... View more