Reading the Same Number of Repeating Fields

The Basics of Reading the Same Number of Repeating Fields

Each record in the file Data97 contains a sales representative's ID number, followed by four repeating fields that represent his or her quarterly sales totals for 1997. You want to pair each employee ID number with one quarterly sales total to produce a single observation. Four observations are generated from each record.
Figure 21.17 Multiple Fields for the Same ID
Raw data file and output file showing ID number and four repeating fields.
To accomplish this, you must execute the DATA step once for each record, repetitively reading and writing values in one iteration.
This means that a DATA step must do the ...

Get SAS Certification Prep Guide, 4th 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.