Creating One Observation per Header Record

Overview

In the previous example, you learned how to create one observation per detail record. But suppose you only want to know how many people reside at each address. You can create a data set that reads each detail record, counts the number of people, and stores this number in a summary variable.
In the example below, this summary variable, Total, is computed for each address. As you can see, creating one observation per header record condenses a large amount of information into a concise data set.
Raw Data File
As you write the DATA step to read this file, you need to think about performing several tasks. ...

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.