11-10-2017 05:22 AM
There are a few papers out on the subject:
These can describe better than a post. Also the SAS documentation is there to provide instructions.
11-10-2017 11:03 AM
DO OVER is deprecated like 20 years ago. People still use it, but you should use the explicit version instead.
SAS maintains its functionality for backwards compatibility but there's a reason you didn't find it in the documentation.
11-10-2017 11:57 AM - edited 11-10-2017 12:05 PM
Not quite right. With EXPLICIT array reference you include the array index value when you reference the array. So you would use references like
do i=1 to dim(x); x(i) = x(i) *100; end;
With IMPLICIT array reference the index value is always in the same variable (default variable is _I_) and if you want to change which element in the array your reference means you change the value of that specific variable. So you do not add anything in the statement that references the variable.
do _i_=1 to 5 ; x = x * 100; end;
do over x ; x = x *100; end;
Not sure why SAS has dropped the DO OVER from the manuals. Personally I feel it is much clearer when you want to apply the same operation to every element in the array. Especially when the index has no meaning of its own, for instance if the elements in the list are not ordered in any meaningful way.
Perhaps they feel it is too hard for the compiler to tell which references are array references if you use implicit array references? Or feel it is too confusing for programmers.
The main thing to know is that for each array you have to stick with just one method of referencing it. You can't use implicit in one statement and explicit in another statement.