Chapter Summary

Text Summary

Hierarchical Raw Data Files

Raw data files can be hierarchical in structure, consisting of a header record and one or more detail records. You can build a SAS data set from a hierarchical file by creating one observation
  • per detail record, storing header data with each observation
  • per header record, combining the information from detail records into summary variables.

Creating One Observation per Detail Record

To create one observation per detail record, it is necessary to distinguish between header and detail records. Having a field that identifies the type of the record makes this task easier.
As you write the DATA step, use a RETAIN statement to retain header data in the PDV until the next ...

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.