Each database is a collection of different tables and each table contains different data in an organized way. While working with data, most of the times information we need is scattered in more than one table. We need joins/merge to get the desired output.
In SAS we use joins while working with Proc SQL
and use merge while working with Data step
. We will now talk only about joins inside Proc SQL
.
Type of join | Output |
---|---|
Proc Sql | SQL procedure inside SAS |
Create Table | Creates a SAS dataset |
Select | Selects required variables from respective datasets |
Where | Specifies particular condition |
Quit | End the procedure |
As mentioned in the introduction, we can also use Merge
inside a data step
which will be discussed under a separate topic. Joins play a very important role to blend and unify data according to the requirement.