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

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.