Previous Page | Next Page

The ACCESS Procedure for PC Files

FORMAT Statement

Changes a SAS format for a PC file column.
Valid: for DBF, DIF, WK1, WK3, WK4, Excel 4, Excel 5, and Excel 95 file formats under Windows operating environments
Applies to: access descriptor or view descriptor
Interacts with: ASSIGN, DROP, RESET

FORMAT|FMT <'column-identifier-1'=><SAS format-name>...<'column-identifier-n'>=<SAS format-name>;


The FORMAT statement changes a SAS variable format from its default format. The default SAS variable format is based on the data type and format of the PC file column. (See your PC file's chapter for information about the default data types and formats that SAS assigns to PC files data.)

An editing statement, such as FORMAT, must follow the CREATE statement and the database-description statements when you create a descriptor.

See the CREATE Statement.

The column-identifier argument can be either the column name or the positional equivalent from the LIST statement. This is the number that represents the column's place in the access descriptor. To associate the DATE9. format with the BIRTHDATE column, and the second column in the access descriptor, submit this statement:

FORMAT 2=DATE9. birthdate=DATE9.;

The column identifier is specified on the left and the SAS format is specified on the right of the expression. The equal sign is optional. If the column name contains lowercase characters, special characters, or national characters, enclose the name in quotation marks. You can enter formats for as many columns as you want in one FORMAT statement.

You can use the FORMAT statement with a view descriptor only if the ASSIGN statement that was used when creating the access descriptor was specified with the NO value.

Note:   When you use the FORMAT statement with access descriptors, the FORMAT statement also re-selects columns that were previously dropped with the DROP statement.  [cautionend]

Previous Page | Next Page | Top of Page