Suppose you have a table
that contains patient names and five health indicators for each patient.
You want to keep a running total of the count of high values for
each patient. You can do this by using five IF-THEN statements or
DO-loops. The only syntax that differs in each statement is the name
of the health indicator column. However, this creates a program that
contains repetitive code and is less efficient. Suppose your data
set had fifty health indicators instead of five. With fifty indicators,
you would need fifty assignment statements. Instead of writing repetitive
code, you can use an array.
A SAS array provides a way to reference a group of columns for processing in ...