ARRAY array-name { subscript } <$><length> <array-elements> <(initial-value-list)>; |
Choose the array name carefully. Do not choose a SAS function name. Do not choose a name that you would likely use as a variable name in your program - so you won't get confused.
An alternative to the code shown above is:
Array Xn{*} X1-X100;
Do I=1 to DIM(Xn);
Xn(I)=I;
End;
Drop I;
The DIM function returns the number of elements in the array.