I'm confused. For every ID there is a different start and stop H variables. For "do i=h_start to H_end;" What do I put in the '_start' and the '_end'?
Edit again to add the post I was referring to.
data want;
set have;
array _h(*) h_1 - h_12;
total_sum = 0;
do i=h_start to H_end;
total_sum = sum(total_sum, _h(i));
end;
run;
Edited to add:
For A I need it to sum H_3 throught H_6, for B I need it to add H_2 though H_5, and C would be H_9 through H_12.
The variable H-Start is the number of H_# I want it to begin summing and the variable H-end has the H I want it to stop at.
... View more