O'Reilly logo

SAS Certification Prep Guide, 4th Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required