From the course: SAS Programming for R Users, Part 1
Unlock this course with a free trial
Join today to access over 22,500 courses taught by industry experts.
Using SAS functions on character data - SAS Tutorial
From the course: SAS Programming for R Users, Part 1
Using SAS functions on character data
- [Instructor] Previously I was just creating and manipulating numeric data. Let's move on now to manipulating some character values. In here I'm going to be using some built in functions like substring, length, prop case, scan and so forth and again I'm going to be using these all in a data step. So here I've listed the function and I've just cherry picked these functions. These are some of my favorite from the online doc page, but there are a ton of built in functions that you can use and in just a few minutes I'll actually show you how to get to these functions on the doc page and I've also provided the description here in the table, but this is really more for a reference. Let's actually look at using these functions. The substring function allows us to extract a certain part of a string. So imagine I'm working with a data table and one of my variables is a count code. I want to create a new variable called organization code and I just want to pull out the last character of the…
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
-
-
-
-
-
Creating new variables and conditional processing5m 38s
-
Conditionally creating variables with a DO group2m 53s
-
Using SAS functions4m 12s
-
Using SAS functions on character data4m 37s
-
Demo: SAS function documentation2m 2s
-
Creating functions for the DATA step5m 20s
-
Subsetting data3m 38s
-
Concatenating data sets2m 18s
-
Match-merging data sets2m 41s
-