Formats

Formats are variable attributes that affect the way data values are written. SAS software offers a variety of character, numeric, and date and time formats. You can also create and store your own formats.

To write values out using some particular form, you select the appropriate format. For example, to display the value 1234 as $1,234 in a report, you can use the DOLLAR6.0 format.

Usually you have to specify the maximum width (w) of the value to be written. Depending on the particular format, you may also need to specify the number of decimal places (d) to be written. For example, to display the value 5678 as 5,678.00 in a report, you can use the COMMA8.2 format, which specifies a width of 8 including 2 decimal places.

SAS format

You can permanently assign a format to a variable in a SAS data set, or you can temporarily specify a format in a PROC step to determine the way the data values appear in output.







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

Terms of Use & Legal Information | Privacy Statement