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 8.2 Separating Unique Observations from Duplicate Observations Based on BY Values

Goal

According to their BY-group values, identify unique and duplicate observations in a data set.

Example Features

Featured StepDATA step
Featured Step Options and StatementsFIRST.variable and LAST.variable temporary variables

Input Data Set

Data set COMPSCISTUDENTS contains enrollment information about four students. Note that three students have duplicate observations: two each for Fred Lopez and Martyn Ross and three for Janie Nguyen.

                              COMPSCISTUDENTS

 Obs  studentid   studentname    department               classid   credits 1 91838 Nguyen, Janie Computer Science 520 2 2 91838 Nguyen, Janie Speech 476 3 3 91838 Nguyen, Janie Speech 476 3 4 91838 Nguyen, Janie Speech 476 ...

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