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(drop=i); set master.temps; array daytemp{365} day1-day365; do i=1 to 365; daytemp{i}=5*(daytemp{i}-32)/9; end; run; You can use arrays to simplify the code needed to
|
1.5 hours |
In this lesson, you learn to
|
complete the following lessons:
|