Previous Page | Next Page

The DATASETS Procedure

ATTRIB Statement


Associates a format, informat, or label with variables in the SAS data set specified in the MODIFY statement.
Restriction: Must appear in a MODIFY RUN group
Featured in: Removing All Labels and Formats in a Data Set

ATTRIB variable list(s) attribute list(s);

Required Arguments

variable list

names the variables that you want to associate with the attributes. You can list the variables in any form that SAS allows.

attribute-list

specifies one or more attributes to assign to variable-list. Specify one or more of the following attributes in the ATTRIB statement:

FORMAT=format

associates a format with variables in variable-list.

Tip: The format can be either a standard SAS format or a format that is defined with the FORMAT procedure.
INFORMAT=informat

associates an informat with variables in variable-list.

Tip: The informat can be either a standard SAS informat or an informat that is defined with the FORMAT procedure.
LABEL='label'

associates a label with variables in the variable-list.


Details

Within the DATASETS procedure, the ATTRIB statement must be used in a MODIFY RUN group and can use only the FORMAT, INFORMAT, and LABEL options. The ATTRIB statement is the simplest way to remove or change all variable labels, formats, or informats in a data set using the keyword _ALL_. For an example, see Removing All Labels and Formats in a Data Set.

Note:   For more information about shortcut methods for specifying variables, see Shortcuts for Specifying Lists of Variable Names.  [cautionend]

If you are not deleting or changing all attributes, it is easier to use the following statements, LABEL Statement, FORMAT Statement, and INFORMAT Statement.

Previous Page | Next Page | Top of Page