The SAS array statement is used to easily tag variables in a data set for processing. The array statement is used in the data step. Example:
array x{3} light water yield;
Following this statement x{1} refers to light, x{2}
refers to water and x{3} refers to yield. This makes it
easy to replace all zero values with the SAS missing value symbol by using the program
do i=1 to 3;
if x{i}=0 then x{i}= . ;
end;
If the data set has many variables then all numeric variables can be placed into an array with the statement
array x{*} _numeric_ ;
The number of entries in the array x is then obtained with dim(x).
The first entry of an array has index 1.
For further information see the SAS Language Reference.
Copyright © 1997 by Jerry Alan Veeh. All rights reserved.