create date macros using data _null_ statement. Then use these variables in your code. data _null_; call symput ('endyear ', put(intnx('year',today(),-2),year4.); /*2012*/ call symput ('previous_yr1 ', put(intnx('year',today(),-3),year4.); call symput ('previous_yr2', put(intnx('year',today(),-4),year4.); call symput ('previous_yr3', put(intnx('year',today(),-5),year4.); call symput ('startyear', put(intnx('year',today(),-6),year4.); run; %put &endyear &previous_yr1 &previous_yr2 &previous_yr3 &startyear ; Proc summary data = test; class premium; var ep &startyear ep &previous_yr3 ep &previous_yr2 ep &previous_yr1 ep &endyear ; output out = test1 sum = run;
... View more