Chapter Contents


Doing More with SAS/ASSIST Software

Creating a Format

The SAS System uses formats and informats to interpret your data. Formats determine how a column value should be displayed, and informats determine how values entered in column fields should be interpreted. You can design your own formats and informats by using Design Format on the Data Management menu. Once you create the formats and informats, you can use them whenever you are prompted for a format or informat for a column.

In this section, you create a numeric format, COSTRNGE., that determines whether the cost of a house in the HOUSES table is low, medium, or high depending on the range in the format. You use this format in the following section, Altering the Properties of a SAS Table.

Additional Information

For additional information about creating formats and informats, refer to "The FORMAT Procedure" chapter in the SAS Procedures Guide.


  1. To display the Create Formats window, follow this selection path:

    Data Management
    Design Format
    Create formats
    The Create Formats window appears.

    Create Formats Window


  2. In the The format name field, type COSTRNGE as the name of the format.

  3. Select Numeric as the type of format.

  4. Type 3 in The number of groups required field. The number of groups indicates how many values or ranges you want to use for the format.

  5. Select Ranges. The Specify Format Ranges window appears.

    Specify Format Ranges Window


    You select Ranges because low, medium, and high cover a range of prices, not specific values.

  6. For Group 1, type 1 as the From Value, 50000 as the To Value, and Low as the Formatted Value.

    For Group 2, type 50001, 100000, and Medium for the From Value, To Value, and Formatted Value, respectively.

    For Group 3, type 100001, 999999, and High for the From Value, To Value, and Formatted Value, respectively.

  7. By leaving the default of Temporary, a temporary format is created in the WORK.FORMATS catalog. The WORK.FORMATS catalog is deleted when you exit the SAS System. An indicator next to Temporary shows that this item is selected. If you select Permanent, the format is permanently stored in the SASUSER.FORMATS catalog.

  8. Select OK twice to create the format. A message appears, indicating that the format was created. Note that a period was appended to the end of the COSTRNGE. format.

  9. To return to the WorkPlace menu from the message window, select Goback twice.

You can now use this format in the HOUSES table. In the following section, you use the Properties window to apply the COSTRNGE. format to the HOUSES table.

Chapter Contents



Top of Page

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