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

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…

Contents