|
data year1999 year.2000 year2001 year2002 year2003 year2004
year2005 year2006 year2007 year2008 year2009 year2010
year2011 year2012;
set dataname;
if substr(var11,1,4)=’1999’ then output year1999;
if substr(var11,1,4)=’2000’ then output year2000;
if substr(var11,1,4)=’2001’ then output year2001;
if substr(var11,1,4)=’2002’ then output year2002;
if substr(var11,1,4)=’2003’ then output year2003;
if substr(var11,1,4)=’2004’ then output year2004;
if substr(var11,1,4)=’2005’ then output year2005;
if substr(var11,1,4)=’2006’ then output year2006;
if substr(var11,1,4)=’2007’ then output year2007;
if substr(var11,1,4)=’2008’ then output year2008;
if substr(var11,1,4)=’2009’ then output year2009;
if substr(var11,1,4)=’2010’ then output year2010;
if substr(var11,1,4)=’2011’ then output year2011;
if substr(var11,1,4)=’2012’ then output year2012;
run;
我的办法比较笨拙,供参考
|