I have a column of numbers
and I want to use them one by one in a do loop. How should I express the dimensions of that array to make the loop read the element of the first row, then the second row, etc...
Using a DATA step, you can load the input data and also use an ARRAY declaration to reference the variable list in a DO I=1 TO DIM(); END; code paragraph. The SAS support http://support.sas.com/ website had SAS-hosted DOC and supplemental technical and conference reference material on the topic.
Suggested Google advanced search argument, this topic / post:
data z.A9 z.B9;
/*This is the data set that contains the array "yr" which is a two dimensional array, rows(24) by columns(6)*/
array yr(6) yr1-yr6;
do n = 1 to 6;
f(n) = quantile('BINOM',yr(n),.5,10);
/* Now in the following loop I want to use the numbers from the first column of the array f*/
/*I don't know how to express the dimensions of the array f in order to use the elements in each row of the array*/
do i=1 to 24;
do j=1 to f(1,i,1)???;
** output to B only when J=f(1,i,1) in the inner loop;
if j=f(1,i,1) then x4=x4+x3;
if j=f(1,i,1) then output z.B9;