Whenever you have a data set with columns like COL1, COL2, COL3 etc and you know they are numeric and you want to add them up in a data step (by creating a new column) you can do the following:
[pre]
data exp;
set exp;
sumofAllCol=sum(of COL:);
run;
[/pre]
Note:
You don't have to know the how many COLn you have!
COL: will add up any column with the prefix COL.
... View more