Using PROC SQL to Join Data

The SQL Procedure

Another method that you can use to join data sets that do not have a common variable is the SQL procedure. You should already be familiar with using PROC SQL to create a table from the results of an inner join.
In a PROC SQL step, you can choose from each input data set only the specific variables that you want to include in the new data set. The input data sets do not need to contain a common BY variable, nor do they need to be sorted or indexed. However, if the lookup table has an index, the SQL procedure can take advantage of the index to provide faster retrieval of lookup values.
You can join up to 256 tables by using the SQL procedure, to combine data horizontally from sources that have any ...

Get SAS Certification Prep Guide, 4th 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.