I suggest you investigate the MEANS procedure. The combination of the MEAN statistic with the WEIGHT statement will do a weighted average. If I understand your description correctly it appears you are weighting by the number of accounts.
Your skeleton code will probably look like something like this:
proc means data = xxx nway;
where risk type in R1 to R5;
weight Number of accts;
output out = xxx_out
You can also do weighted averages in the REPORT procedure but the learning curve is much higher.