Another approach apart from the array one given above, is to use the basica functionality of datasets and merging. Instead of putting data into macro variables, put data into datasets (clue in the name there). This data can then simply be merged on to be used:
data consts;
year=2010; rate=1.25;
year=2011; rate=1.30;
...
run;
proc sql;
create table WANT as
select A.*,
B.RATE,
A.DOLLARAMT * B.RATE as ACTUAL
from HAVE A
left join CONSTS B
on A.REFYR=B.YEAR;
quit;
The above is just an example, but is there to illustrate how simple it is to merge two datasets to get an outcome, no need for looping, macro variables, messy code etc.
... View more