So you have a string containing numbers, right? See this:
data have;
input year dividend $;
datalines;
2010 10
2011 11,15
2012 16
2013 20
;
data want;
set have;
do i = 1 to countw(dividend,',');
div_num = sum(div_num,input(scan(dividend,i,','),best32.));
end;
drop i;
run;
proc print data=want noobs;
run;
So you have a string containing numbers, right? See this:
data have;
input year dividend $;
datalines;
2010 10
2011 11,15
2012 16
2013 20
;
data want;
set have;
do i = 1 to countw(dividend,',');
div_num = sum(div_num,input(scan(dividend,i,','),best32.));
end;
drop i;
run;
proc print data=want noobs;
run;