SAS Data Set Options |
Valid in: | DATA step and PROC steps |
Category: | Data Set Control |
Syntax | |
Syntax Description | |
Details | |
Comparisons | |
Examples | |
See Also |
Syntax |
LABEL='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, or use two single quotation marks in the label text and surround the string with 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.
A label assigned to a data set remains associated with that data set when you update a data set in place, such as when you use 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, a label previously assigned to data set ONE is lost when you create the new output data set ONE in this DATA step:
data one; set one; run;
Comparisons |
The LABEL= data set option enables you to specify labels only for data sets. You can specify labels for the variables in a data set using the LABEL statement.
The LABEL= option in the ATTRIB statement also enables you to assign labels to variables.
Examples |
These examples assign 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 |
| |||||||
The CONTENTS Procedure in Base SAS Procedures Guide | |||||||
The DATASETS Procedure in Base SAS Procedures Guide |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.