Hi everyone and merry xmas!
I have a quick question, that i don't quite know how to google.
I have a datastep with arrays in it:
data rotate;
set retain_test;
by bp_2;
retain numabb17-numabb43;
array Anumabb(17:43) numabb17-numabb43;
if first.bp_2 then do;
do i = 17 to 43;
Anumabb = .;
end;
end;
Anumabb(week) = numabb;
if last.bp_2 then output;
drop week i;
run;
This is just part of the code. What i would like to do, is to have two variables for the weeknumbers. So instead of writeing 17 and 43, i predefine them above, and then i can change them as i wish to.
Im thinking something like this:
startweek = 17
endweek = 43
data rotate;
set retain_test;
by bp_2;
retain numabb(startweek)-numabb(endweek);
array Anumabb((startweek):(endweek) numabb(startweek)-numabb(endweek);
if first.bp_2 then do;
do i = (startweek) to (endweek);
Anumabb = .;
end;
end;
Anumabb(week) = numabb;
if last.bp_2 then output;
drop week i;
run;
Any ideas?
Thanks!
Toby
Message was edited by: TMorville