Your data can't be in that format, you have character and numeric values in the same variable. Assuming your interest rates have the variable names ir1-ir12, where ir1=January's interest rate and Ir12 = Decembers interest rate something like the following will work. I think you have some calculation mistakes in your example though, an interest rate of 1.3% is 1.013 not 1.13. data have; informat ir1-ir12 percent.; format ir1-ir12 percent8.1; input company $ ir1-ir12 ; cards; CompanyA 1.3% 3.9% 1.7% 0.5% 0.1% 3% 4% 5% 1% 0.7% 6% 4.7% ; run; data want; set have; array ir(12) ir1-ir12; monthly=3000; value=0; do i=1 to 10; *for 10 years; do j=1 to 12; *for 12 months/year; value=(value+monthly)*(1+ir(j)); end; output; end; run;
... View more