Chapter Summary

Text Summary

Purpose of SAS Arrays

An array is a temporary grouping of variables under a single name. This can reduce the number of statements needed to process variables and can simplify the maintenance of DATA step programs.

Defining an Array

To group variables into an array, use an ARRAY statement that specifies the array's name; its dimension enclosed in braces, brackets, or parentheses; and the elements to include. For example: array sales{4} qtr1 qtr2 qtr3 qtr4;

Variable Lists as Array Elements

You can use a variable list to specify array elements. Depending on the form of the variable list, it can specify all numeric or all character variables, or a numbered range of variables.

Referencing Elements of an ...

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.