Example 3.10 Generating Every Combination of Rows between Tables Based on a Common Column

Goal

Combine two tables that have a common column where the common column has duplicate values in both tables. Produce a table that contains all possible combinations of the rows where the values from the common column match.

Example Features

Featured StepPROC SQL
Featured Step Options and StatementsFull join with WHERE clause
Related TechniqueHash iterator object in the DATA step

Input Tables

Table MEETINGS contains events to be held on two days and the expected attendance for each event. Table MEETINGROOMS contains meeting rooms that are available for the same two days. The column in common between the two tables is MEETINGDATE with multiple occurrences ...

Get Combining and Modifying SAS® Data Sets: Examples Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.