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 2.6 Selecting Observations Unique to Each Data Set When Concatenating Data Sets

Goal

Select observations found in only one data set among a group of data sets based on the value of a specific variable. Concatenate the selected observations.

Example Features

Featured StepPROC SORT DATA step
Featured Step Options and StatementsMERGE statement with IN= option (match-merge)
Related TechniquePROC SQL, OUTER UNION set operator, GROUP BY and HAVING clauses

Input Data Sets

Data sets MARCHRUNNERS, APRILRUNNERS, and MAYRUNNERS contain the names and running times for the runners in the month that is specified in the data set name.

          MARCHRUNNERS

Obs  runner         racetime 1 Sanchez, SO 35:49.4 2 Flores, RX 38:32.8 3 Martinez, KF 36:12.3 4 Hayes, MU 35:24.7 ...

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