I have a table whose description is as shown in the log is:
create table WORK.EMP( bufsize=65536 )
(
Series_Name char(21) format=$21. informat=$21.,
Series_Code char(17) format=$17. informat=$17.,
Country_Name char(19) format=$19. informat=$19.,
Country_Code char(3) format=$3. informat=$3.,
_2000__YR2000_ char(12) format=$12. informat=$12.,
_2001__YR2001_ char(12) format=$12. informat=$12.,
_2002__YR2002_ char(12) format=$12. informat=$12.,
_2003__YR2003_ char(12) format=$12. informat=$12.,
_2004__YR2004_ char(11) format=$11. informat=$11.,
_2005__YR2005_ char(11) format=$11. informat=$11.,
_2006__YR2006_ char(11) format=$11. informat=$11.,
_2007__YR2007_ char(12) format=$12. informat=$12.,
_2008__YR2008_ char(12) format=$12. informat=$12.,
_2009__YR2009_ char(12) format=$12. informat=$12.,
_2010__YR2010_ char(12) format=$12. informat=$12.,
_2011__YR2011_ char(12) format=$12. informat=$12.,
_2012__YR2012_ char(12) format=$12. informat=$12.,
Total12 num label='Total12'
);
Now I want to sum the columns from year 2000 to 2012 and put the result into the column named 'Total12', but first i think should convert the 'char' data types into 'int' to do the calculations. I have tried the following code in SAS:
proc sql;
alter table emp modify _2000__YR2000_ num;
alter table emp modify _2001__YR2001_ num;
run;
But it gives me following error:
ERROR: You cannot alter '_2000__YR2000_' to be a numeric column.
What should i do now?