SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Formatting Variable Values
Creating User-Defined Formats


Introduction to PROC FORMAT

Sometimes variable values are stored according to a code. For example, when the PRINT procedure displays the data set Perm.Empinfo, notice that the values for JobTitle are coded, and they are not easily interpreted.


Obs FirstName LastName JobTitle Salary
1 Donny Evans 112 29996.63
2 Lisa Helms 105 18567.23
3 John Higgins 111 25309.00
4 Amy Larson 113 32696.78
5 Mary Moore 112 28945.89
6 Jason Powell 103 35099.50
7 Judy Riley 111 25309.00
8 Neal Ryan 112 28180.00


You can display more descriptive values for these variables. Here is how a report might look that has formatted values for the variable JobTitle. The predefined SAS formats cannot help here.


Obs FirstName LastName JobTitle Salary
1 Donny Evans technical writer 29996.63
2 Lisa Helms text processor 18567.23
3 John Higgins assoc. technical writer 25309.00
4 Amy Larson senior technical writer 32696.78
5 Mary Moore technical writer 28945.89
6 Jason Powell manager 35099.50
7 Judy Riley assoc. technical writer 25309.00
8 Neal Ryan technical writer 28180.00
9 Henry Wilson senior technical writer 31875.46
10 Chip Woods text processor 17098.71


However, you can use the FORMAT procedure to define your own formats for displaying values of variables.


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement