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.3 Combining Observations When Variable Values Do Not Match Exactly

Goal

Perform a fuzzy merge by merging observations from two data sets based on data values that do not match exactly.

Example Features

Featured StepPROC SQL
Featured Step Options and StatementsSELECT statement with FULL JOIN and ON clause

Input Tables

Table BATCH_ONE contains times and sample numbers for seven samples. Table BATCH_TWO contains times and sample numbers for nine samples.


        BATCH_ONE

Obs            samptime    sample
 1   23NOV2009:09:01:00      100
 2   23NOV2009:10:03:00      101
 3   23NOV2009:10:58:00      102
 4   23NOV2009:11:59:00      103
 5   23NOV2009:13:00:00      104
 6   23NOV2009:14:02:00      105
 7   23NOV2009:16:00:00      106

           BATCH_TWO

Obs             samptime    sample 1 23NOV2009:09:00:00 200 2 23NOV2009:09:59:00 ...

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