Hi. I would like to initialise my array by assigning each element with a zero value. I can do this through a do loop but I thought that I could do something neater / better by doing something like this:
I have had some success with this using SET with the POINT= option.
This example is completely contrived but it may serve well enough to illustrate a way to initialize a list of variables without looping over all the elements of an array.
[pre]
data initArray;
array v[5];
retain v 0;
run;
data workWithArray;
array v[5];
do i = 1 to 6;
if i in(1,2,4) then set initArray point=point;
else do j = 1 to dim(v);
v = ranuni(1);
end;
output;
end;
retain point 1;
stop;
run;
proc print;
run;
[pre]