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 ...

Get Combining and Modifying SAS® Data Sets: Examples Second 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.