Creating One-Dimensional Arrays

ARRAY Statement Syntax

An ARRAY statement groups data set variables into an array.
Syntax, ARRAY statement:
ARRAY array-name{dimension} <elements>;
  • array-name specifies the name of the array.
  • dimension describes the number and arrangement of array elements.
  • elements lists the variables to include in the array. Array elements must be either all numeric or all character. If no elements are listed, new variables are created with default names.
Note: Do not give an array the same name as a variable in the same DATA step. Also, avoid using the name of a SAS function; the array is correct, but you will not be able to use the function in the same DATA step, and a warning message appears ...

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.