Processing Variables with Arrays |
Lesson
Overview |
Introduction
In DATA step programming, you often need to perform the same action on more than one variable. Although you can process variables individually, it is easier to handle them as a group. You can do this by using array processing. For example, using an array and DO loop, the program below eliminates the need for 365 separate programming statements to convert the daily temperature from Fahrenheit to Celsius for the year. data work.report; set master.temps; array daytemp(365) day1-day365; do i=1 to 365; daytemp(i)=5*(daytemp(i)-32)/9; end; run; This lesson teaches you how to define an array and reference elements of the array in the DATA step. This lesson contains 30 pages and takes approximately 45-60 minutes to complete.
After completing this lesson, you will be able to
Before taking this lesson, you should have completed the following lessons: Getting Started with SAS Programming |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.