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.4 Combining Observations by the Formatted Value of a Variable

Goal

Perform a fuzzy merge by merging observations from two data sets based on the formatted version of the matching variable rather than the stored value.

Example Features

Featured StepDATA step
Featured Step Options and StatementsBY statement with GROUPFORMAT option
Related TechniquePROC SQL, left join, ON clause with functions

Input Data Sets

Data set PRIZES contains a list of four prizes and the last day of the month in which they are awarded. Data set PARTICIPANTS contains a list of participants who will receive a prize dependent on a completion date.

                PRIZES

 Obs   completed  prize 1 01/31/2009 Restaurant Certificate 2 02/28/2009 Audio Player 3 03/31/2009 Theater Tickets ...

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