From the course: SAS Programming for R Users, Part 1
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Concatenating data sets - SAS Tutorial
From the course: SAS Programming for R Users, Part 1
Concatenating data sets
- [Narrator] Now that we know how to subset data, what if we want to go ahead and column bind or row bind our data back together again? To reproduce the rbind function in r, we'll use a data step. And in the set statement, we'll specify all the data sets we want to row bind. So imagine I have two data sets here, Employees Denmark and Employees France, and I just want to stack them on top of each other and create a new data set called Employees All. Well, I'll just pass the Employees Denmark data table and the Employees France data table to a single set statement and it'll simply stack them on top of each other. The important thing to remember here is, they have to have the exact same column names, otherwise you'll get a block diagonal data table for Employees All. On the other hand, if I have two separate data sets names and home, and I want to column bind them together, I'll use multiple set statements, or you can think of it as creating a column of set statements. And each set…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Creating new variables and conditional processing5m 38s
-
(Locked)
Conditionally creating variables with a DO group2m 53s
-
(Locked)
Using SAS functions4m 12s
-
(Locked)
Using SAS functions on character data4m 37s
-
(Locked)
Demo: SAS function documentation2m 2s
-
(Locked)
Creating functions for the DATA step5m 20s
-
(Locked)
Subsetting data3m 38s
-
(Locked)
Concatenating data sets2m 18s
-
(Locked)
Match-merging data sets2m 41s
-
(Locked)