LABEL= Data Set Option

Specifies a label for a SAS data set.

Valid in: DATA and PROC steps
Category: Data Set Control
Supports: SAS data set

Syntax

LABEL='label'

Syntax Description

'label'

specifies a text string of up to 256 characters. If the label text contains single quotation marks, use double quotation marks around the label. As an alternative, use two single quotation marks in the label text and enclose the string in single quotation marks. To remove a label from a data set, assign a label that is equal to a blank that is enclosed in quotation marks.

Details

You can use the LABEL= option on both input and output data sets. When you use LABEL= on input data sets, it assigns a label for the file for the duration of that DATA or PROC step. When it is specified for an output data set, the label becomes a permanent part of that file and can be printed using the CONTENTS or DATASETS procedure, and modified using PROC DATASETS.

Comparisons

  • The LABEL= data set option enables you to specify labels only for data sets. You can specify labels for the columns in a data set using the LABEL statement.
  • The LABEL= option in the ATTRIB statement also enables you to assign labels to columns.

Example: Assigning Labels to Data Sets

These examples assign labels to data sets:
data myfiles.w2 (label='1976 W2 Info, Hourly');
data myfiles.new (label='Peter''s List');
data myfiles.new (label="Hillside's Daily Account");
data myfiles.sales (label='Sales For May(NE)');