While an appreciation of different ways of combining datasets is necessary, the most important methodology in SAS is merging datasets. It is time to look at one-to-many and many-to-many merges. Along with these two types of merges, we will also look at the concept of BY MATCHING.
Merging
By Matching
For performing By Matching, we have the following information about the cost of living in two different datasets, A and B, at hand:
We want to join the two datasets together so that we have one wide dataset with 10 rows of observations for City and nine variables.
Let's use the same form of Merge that we used earlier when generating the output for Merging:
Data Cost_Living;
Merge A B;
Run;
We get the desired output in the following...