Example 3.6 Combining Rows When There Is No Common Column
Combine rows from two tables based on specific criteria, even when there is no column common to the two tables.
|Featured Step||PROC SQL|
|Featured Step Options and Statements||Full join, WHERE clause with BETWEEN operator|
|Related Technique||DATA step, multiple SET statements, POINT= and NOBS= options|
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 ...