Definitions for Array Processing
array
is a temporary grouping of SAS variables that are arranged in a particular order and
identified by an array-name. The array exists only for the duration of the current
DATA step. The array-name distinguishes it from any other arrays in the same DATA
step; it is not a variable.
Note: Arrays in SAS are different from those in many other programming
languages. In SAS, an array is not a data structure. An array is just a convenient
way of temporarily identifying a group of variables.
array processing
is a method that enables you to perform the same tasks for a series of related
variables.
array reference
is a method to reference the elements of an array.
one-dimensional array
is a simple grouping of variables that, when processed, results in output that can be
represented in simple row format.
multidimensional array
is a more complex grouping of variables that, when processed, results in output that
could have two or more dimensions, such as columns and rows.
Basic array processing involves the following steps:
grouping variables into arrays
selecting a current variable for an action
repeating an action
A Conceptual View of Arrays
One-Dimensional Array
The following figure is a conceptual representation of two one-dimensional arrays, Misc
and Mday.
Figure 25.1 One-Dimensional Array
Variables
1
mi s c 1
Arrays
MI S C
2
mi s c 2
3
mi s c 3
4
mi s c 4
5
mi s c 5
6
mi s c 6
7
mi s c 7
8
mi s c 8
1
md a y 1
MDAY
2
md a y 2
3
md a y 3
4
md a y 4
5
md a y 5
6
md a y 6
7
md a y 7
566 Chapter 25 Array Processing

Get SAS 9.4 Language Reference, 6th 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.