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 ...

Get SAS Certification Prep Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.