The Basics of SAS Arrays
An array is
a temporary grouping of SAS variables that are arranged in a particular
order and identified by an array name. Here are several facts about
arrays.
-
Arrays exist only for the duration of the current DATA step.
-
Arrays are referenced by the array name and a subscript.
-
The array name is not a variable.
An array is a convenient
way of temporarily identifying a group of variables. Arrays are often
referenced in DO loops because more than one element in an array must
be processed.
One reason for using an array is to reduce the number of statements that are required for processing variables. For example, in the DATA step below, the values of seven data set variables are converted from Fahrenheit ...
Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.