Previous Page | Next Page

The DATASETS Procedure

FORMAT Statement


Permanently assigns, changes, and removes variable formats in the SAS data set specified in the MODIFY statement.
Restriction: Must appear in a MODIFY RUN group
Featured in: Modifying SAS Data Sets

FORMAT variable-1 <format-1>
<...variable-n <format-n>>;


Required Arguments

variable-1 <...variable-n>

specifies one or more variables whose format you want to assign, change, or remove. If you want to disassociate a format with a variable, list the variable last in the list with no format following:

   format x1-x3 4.1 time hhmm2.2 age;

Options

format

specifies a format to apply to the variable or variables listed before it. If you do not specify a format, the FORMAT statement removes any format associated with the variables in variable-list.

Tip: To remove all formats from a data set, use the ATTRIB Statement and the _ALL_ keyword.

Previous Page | Next Page | Top of Page