Creating One-Dimensional Arrays

Understanding SAS Arrays

A SAS array is a temporary grouping of SAS variables under a single name. An array exists only for the duration of the DATA step.
SAS Array Variables
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 to Celsius temperatures.
data work.report; 
   set master.temps; 
   mon=5*(mon-32)/9; 
   tue=5*(tue-32)/9; 
   wed=5*(wed-32)/9; 
   thr=5*(thr-32)/9; 
   fri=5*(fri-32)/9; 
   sat=5*(sat-32)/9; 
   sun=5*(sun-32)/9; 
run;
As you can see, the assignment statements perform ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third 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.