SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Formatting Variable Values
Review of SAS Formats and the FORMAT Statement


In the Introduction to SAS Programming module, you worked with two SAS formats:
  • COMMAw.d displays numeric values with commas
  • DOLLARw.d displays numeric values with a leading dollar sign ($) and commas.

You also learned that SAS formats specify a w value, which is the width that is used for displaying the value. A period follows the w value.

     dollar9.    $ 5 , 3 4 9 . 4 1
           ^     1 2 3 4 5 6 7 8 9

Numeric SAS formats, such as the DOLLARw.d format, can also specify a d value, which is the number of decimal places to be displayed. Note that a period separates the w from the d value.

     dollar9.2    $ 5 , 3 4 9 . 4 1
             ^    1 2 3 4 5 6 7 8 9

back||next


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

Terms of Use & Legal Information | Privacy Statement