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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.