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

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…

Contents