LABEL= Data Set Option

Specifies a label for a SAS data set.

Valid in: DATA step and PROC steps
Category: Data Set Control

Syntax

LABEL='label'

Syntax Description

'label'

specifies a text string of up to 256 characters. If the label text contains single quotation marks, enclose the label in double quotation marks. To remove a label from a data set, assign a blank space that is enclosed in quotation marks to the label.

You can also use two single quotation marks in the label text and enclose the string in single quotation marks.

Details

You can use the LABEL= option on input and output data sets. When you specify LABEL= on input data sets, it assigns a file label for the duration of that DATA step or PROC step. When you specify LABEL= for an output data set, the label becomes a permanent part of that file. The file can be printed using the CONTENTS or DATASETS procedure, and modified using PROC DATASETS.
A label that is assigned to a data set remains associated with that data set when you update a data set by using the APPEND procedure or the MODIFY statement. However, a label is lost if you use a data set with a previously assigned label to create a new data set in the DATA step. For example:
data one;
     set one;
run;

Comparisons

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

Example: Assigning Labels to Data Sets

data w2(label='1976 W2 Info, Hourly');
data new(label='Peter''s List');
data new(label="Hillside's Daily Account");
data sales(label='Sales For May(NE)');

See Also

Statements:
ATTRIB Statement in SAS Statements: Reference
LABEL Statement in SAS Statements: Reference
MODIFY Statement in SAS Statements: Reference
Procedures:
CONTENTS Procedure in Base SAS Procedures Guide
DATASETS Procedure in Base SAS Procedures Guide