The DATA step could also be written without arrays, if we do not need to show the distribution of the individual values.

data _null_;
simsize=10000;
do i = 1 to simsize;
sum=0;
do j = 1 by 1 until(sum>1);
sum+ranuni(0);
end;
totsum+j;
end;
mean=totsum/simsize;
put mean= simsize=;
run;