From the course: SAS® 9.4 Cert Prep: Part 12 Combining Tables

Unlock this course with a free trial

Join today to access over 22,500 courses taught by industry experts.

Demo: Combining

Demo: Combining

- [Narrator] We'll use the data step merge to combine two tables with matching rows. Let's start with these first two proc sort steps in this program. These two steps are arranging these input data sets, storm_summary and storm_basincodes. You'll notice one is being sorted by Basin and the other by BasinCode. I'm going to run both and we'll take a look at the tables. So looking at STORM_SORT, we have our Basin column with our two letter codes. The other table that we created was BASINCODES_SORT. Which serves as our lookup table. It has our two letter BasinCodes, but you'll notice it's named differently than the other table. Here it's BasinCode. Also included in this table, is the full description of the BasinName. So as a follow-up step, what we would like to do is merge these two tables together, so that we can add the full BasinName to our STORM_SUMMARY table. To accomplish this, we can do it with a data step merge.…

Contents