Chapter Contents

Previous

Next
The FORMAT Procedure

Overview

The FORMAT procedure enables you to define your own informats and formats for variables. In addition, you can print the contents of a catalog that contains informats or formats, store descriptions of informats or formats in a SAS data set, and use a SAS data set to create informats or formats.

Informats determine how raw data values are read and stored. Formats determine how variable values are printed. For simplicity, this section uses the terminology the informat converts and the format prints.

Informats and formats tell the SAS System the data's type (character or numeric) and form (such as how many bytes it occupies; decimal placement for numbers; how to handle leading, trailing, or embedded blanks and zeros; and so forth). The SAS System provides informats and formats for reading and writing variables. For a thorough description of informats and formats that SAS provides, see the sections on formats and informats in SAS Language Reference: Dictionary.

With informats, you can

With formats, you can

The following figure summarizes what occurs when you associate an informat and format with a variable. The COMMAw.d informat and the DOLLARw.d format are provided by SAS.

[IMAGE]

In the figure, SAS reads the raw data value that contains the dollar sign and comma. The COMMA9.2 informat ignores the dollar sign and comma and converts the value to 1544.32. The DOLLAR9.2 format prints the value, adding the dollar sign and comma. For more information about associating informats and formats with variables, see Associating Informats and Formats with Variables .


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.