Additional Features

You've seen a number of uses for arrays, including creating variables, performing repetitive calculations, and performing table lookups. You can also use arrays for rotating (transposing) a SAS data set.
When you rotate a SAS data set, you change variables to observations or observations to variables. For example, suppose you want to rotate the Finance.Funddrive data set to create four output observations from each input observation.
SAS Data Set Finance.Funddrive
The following program rotates the data set and lists the first 16 observations in the new data set.
 data work.rotate(drop=qtr1-qtr4); set finance.funddrive; array contrib{4} qtr1-qtr4; ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.