Arrays Made Easy

From sasCommunity
Jump to: navigation, search

Paper 242-30 (SUGI 2005 presentation)

Arrays Made Easy: An Introduction to Arrays and Array Processing

Steven First, President and Teresa Schudrowitz, Project Manager

Systems Seminar Consultants

Abstract

Many programmers often find the thought of using arrays in their programs to be a daunting task, and as a result they often shy away from arrays in their code in favor of better-understood, but more complex solutions. A SAS array is a convenient way of temporarily identifying a group of variables for processing within a data step. Once the array has been defined the programmer is now able to perform the same tasks for a series of related variables, the array elements. Once the basics of array processing are understood arrays are a simple solution to many program scenarios.

This paper reviews the following array topics:

  1. Why do we need arrays?
  2. Basic array concepts
    1. Definition
    2. Elements
    3. Syntax
    4. Rules
  3. Using array indexes
  4. One dimension arrays
  5. Multi-dimension arrays
  6. Temporary arrays
  7. Explicit vs. implicit subscripting
  8. Sorting arrays
  9. When to use arrays
  10. Common errors and misunderstandings

Online resources

View This and Other Papers and Presentations by Systems Seminar Consultants.