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.6 Combining Rows When There Is No Common Column

Goal

Combine rows from two tables based on specific criteria, even when there is no column common to the two tables.

Example Features

Featured StepPROC SQL
Featured Step Options and StatementsFull join, WHERE clause with BETWEEN operator
Related TechniqueDATA step, multiple SET statements, POINT= and NOBS= options

Input Tables

Tables BUILD_PROJECTS and BUILD_BILLS have no common column. The dates associated with each project in BUILD_PROJECTS do not overlap with any other project.

          BUILD_PROJECTS

Obs  start_date    end_date  project 1 01/08/2010 01/27/2010 Basement 2 02/01/2010 02/12/2010 Frame 3 02/15/2010 02/20/2010 Roofing 4 02/22/2010 02/27/2010 Plumb 5 03/02/2010 03/05/2010 Wire 6 03/08/2010 ...

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