LABEL Statement


Assigns descriptive labels to variables

Valid: in a DATA step

Category: Information

Type: Declarative

Syntax

LABEL variable-1= label-1 ...< variable-n= label-n >;

LABEL variable-1= ...< variable-n= >;

Arguments

variable

  • names the variable that you want to label.

  • Tip: Optionally, you can specify additional pairs of labels and variables.

label

  • specifies a label of up to 256 characters , including blanks.

  • Tip: Optionally, you can specify additional pairs of labels and variables.

  • Tip: For more information about including quotation marks as part of the label, see Character Constants in SAS Language Reference: Concepts .

  • Restriction: You must enclose the label in either single or double quotation marks.

  • removes a label from a variable. Enclose a single blank space in quotation marks to remove an existing label.

Details

Using a LABEL statement in a DATA step permanently associates labels with variables by affecting the descriptor information of the SAS data set that contains the variables. You can associate any number of variables with labels in a single LABEL statement.

You can use a LABEL statement in a PROC step, but the rules are different. See the Base SAS Procedures Guide for more information.

Comparisons

Both the ATTRIB and LABEL statements can associate labels with variables and change a label that is associated with a variable.

Examples

Example 1: Specifying Labels

Here are several LABEL statements:

  •  label compound=Type of Drug; 
  •  label date="Todays Date"; 
  •  label n='Mark''s Experiment Number'; 
  •  label score1="Grade on April 1 Test"        score2="Grade on May 1 Test"; 

Example 2: Removing a Label

This example removes an existing label:

 data rtest;     set rtest;     label x= ;  run; 

See Also

Statement:

  • ATTRIB Statement on page 1109




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net