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.
Converting numeric values to character values - SAS Tutorial
From the course: SAS® 9.4 Cert Prep: Part 10 Manipulating Data with Functions
Converting numeric values to character values
- [Instructor] Now let's do the opposite conversion, numeric to character. The PUT function can be used to convert a numeric column to a character column. The PUT function has two arguments. The first argument is the source which is the column that you want to convert from numeric to character. The second argument is the format. The format tells SAS how to display the new character value. Suppose you have a numeric date column and you want to create a character day column that has the first three letters of the day of the week for the particular date. The PUT function reads the numeric value in date and converts it to a character value using the format downame3. Here's some examples of formats that can be used to convert numeric values to character values. Formats in the PUT function work like formats that you use to display values. You specify the format, width, and decimal value for how you want the character value…
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)