Previous Page | Next Page

The ACCESS Procedure for Relational Databases

FORMAT Statement


Changes a SAS format for a DBMS column
Applies to: access descriptor or view descriptor
Interaction: ASSIGN, DROP, RESET

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

column-identifier

specifies the column name or the positional equivalent from the LIST statement, which is the number that represents the column's place in the access descriptor. If the column name contains lowercase characters, special characters, or national characters, enclose the name in quotation marks.

SAS-format-name

specifies the SAS format to be used.


Details

The FORMAT statement changes SAS variable formats from their default formats. The default SAS variable format is based on the data type of the DBMS column. See SAS/ACCESS documentation for your DBMS for information about default formats that SAS assigns to your DBMS data types.

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. When you use the FORMAT statement with access descriptors, the FORMAT statement also reselects columns that were previously dropped with the DROP statement.

For example, to associate the DATE9. format with the BIRTHDATE column and with the second column in the access descriptor, submit this statement:

format 2=date9. birthdate=date9.;

The equal sign (=) is optional. For example, you can use the FORMAT statement to specify new SAS variable formats for four DBMS table columns:

   format productid  4.
          weight     e16.9
          fibersize  e20.13
          width      e16.9;

Previous Page | Next Page | Top of Page