Abstract |
SAS formats are a very powerful tool. They allow you to display the data in a more readable manner without modifying it. Formats can also be used to group data into categories for use in various procedures like PROC FREQ, PROC TTEST, and PROC MEANS (as a class variable). As with many powerful tools, there are some 'gotchas' to be aware of. Formats can crash a program without specific options. They can produce misleading information; this is especially true for picture format. There are many aspects of formats to consider, including 'built-in' or 'user defined' formats. A format may be temporary or permanent. The PUT and INPUT functions can be used to generate new variables using formats. If you have several format libraries, managing the formats can be difficult. The SAS dictionary tables are useful in managing the different formats. Code and output examples demonstrate the various uses and potential abuses of SAS formats. This paper is an introduction to SAS formats and the related informats. Included is information on what a format is and why they are useful. There are examples of how to use and create formats. In addition, some potential errors are discussed. |