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

Expanding Your Use of Arrays

Creating Variables in an ARRAY Statement

Previous examples showed several ways to reference existing variables in an ARRAY statement. You can also create variables in an ARRAY statement by omitting the array elements from the statement. If you do not reference existing variables, SAS automatically creates new variables for you and assigns default names to them. The default name is the array-name followed by consecutive numbers 1 to the dimension of the array.
Syntax, ARRAY statement to create new variables:
ARRAY array-name{dimension};
  • array-name specifies the name of the array.
  • dimension describes the number and arrangement of array elements.
For example, suppose you need to calculate ...

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