SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Formatting Variable Values
Creating User-Defined Formats

 

The VALUE range specifies
  • a single value, such as 24 or 'S'
  • a range of numeric values, such as 0-1500
  • a range of character values enclosed in quotation marks, such as 'A'-'M'.
  • a list of unique values separated by commas, such as 90,180,270 or 'B','D','F'. The list must contain either all numeric values or all character values.
When the specified values are character values, they must be enclosed in quotation marks and must match the case of the variable's values. The format's name must also start with a dollar sign ($). For example, the VALUE statement below defines the $GRADE format, which displays the character values as text labels.
     proc format lib=library;
        value $grade
              'A'='Good'
              'B'-'D'='Fair'
              'F'='Poor'
              'I','U'='See Instructor';
     run;
When the specified values are numeric values, they are not enclosed in quotation marks, and the format's name should not begin with a dollar sign ($). The VALUE statement that defines the format JOBFMT assigns labels to numeric values.
     proc format lib=library;
        value jobfmt
              103='manager'
              105='text processor'
              111='assoc. technical writer'
              112='technical writer'
              113='senior technical writer';
     run;




back||next


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

Terms of Use & Legal Information | Privacy Statement