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

Reading Repeating Blocks of Data

The Basics of Reading Repeating Blocks of Data

Consider this example data. Each record in the file Tempdata contains three blocks of data. Each block contains a date followed by the day's high temperature in a small city located in the southern United States.
Figure 21.1 Raw Data File Tempdata
Raw Data File Tempdata showing the date and high temperature.
You could write a DATA step that reads each record and creates three different Date and Temp variables.
Figure 21.2 Three Date and Temp Variables
SAS data set showing three Date and Temp variables.
Alternatively, you could create a separate observation for each block ...

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