O'Reilly logo

Combining and Modifying SAS® Data Sets: Examples Second Edition by Michele M. Burlew

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

Example 3.12 Combining and Collapsing Observations Based on a Common Variable

Goal

Reshape a transaction data set by turning related observations into single ones. Match each collapsed observation from the transaction data set with an appropriate observation from the master data set, based on the value of a key variable.

Example 3.13 also combines and collapses observations based on a common variable, but its transaction data set is indexed on the common variable and it uses index features to combine the observations.

Example Features

Featured StepPROC TRANSPOSE and DATA step
Featured Step Options and StatementsPROC TRANSPOSE: BY, ID, and VAR statements, PREFIX= option DATA step: match-merge by common variable
Related TechniqueDATA step, arrays, ...

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