From the course: SAS® 9.4 Cert Prep: Part 10 Manipulating Data with Functions
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Demo: Using the PUT function to convert column types - SAS Tutorial
From the course: SAS® 9.4 Cert Prep: Part 10 Manipulating Data with Functions
Demo: Using the PUT function to convert column types
- [Instructor] Let's continue manipulating the Weather Atlanta table by converting some numeric columns to character columns using the put function. Back in the program, let's move on to the second data step where we're going to use the put function. Before I do anything, let's run this data step and see what we're starting with. You'll notice that we're creating a column called CityStateZip that is concatenating together the city, just the string GA for Georgia, and the zip code. The first argument in the catx function, space, indicates that each of those strings will be concatenated together, leading and trailing blanks will be removed, and a single space will be inserted. But recall zip code is a number. Is that going to impact our results? Well, let's see. CityStateZip looks great. The cat functions automatic convert numeric values to character values, and like I said, remove leading and trailing blanks…
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)
Handling column type35s
-
(Locked)
Converting column type1m 18s
-
(Locked)
Converting character values to numeric values1m 33s
-
(Locked)
Using a generic informat to read dates1m 33s
-
(Locked)
Converting the type of an existing column1m 46s
-
(Locked)
Converting numeric values to character values1m 2s
-
Demo: Using the INPUT function to convert column types7m 9s
-
(Locked)
Demo: Using the PUT function to convert column types3m 38s
-
(Locked)