VARLABEL Function


VARLABEL Function

Returns the label assigned to a SAS data set variable

Category: SAS File I/O

Syntax

VARLABEL ( data-set-id , var-num )

Arguments

data-set-id

  • specifies the data set identifier that the OPEN function returns.

var-num

  • specifies the number of the variable's position in the SAS data set.

  • Tip: This number is next to the variable in the list that is produced by the CONTENTS procedure.

  • Tip: The VARNUM function returns this number.

Details

If no label has been assigned to the variable, a blank string is returned.

Comparisons

VLABEL returns the label that is associated with the given variable.

Examples

This example obtains the label of the variable NAME in the SAS data set MYDATA.

Example Code 4.1: Obtaining the Label of the Variable NAME
start example
 %let dsid=%sysfunc(open(mydata,i));  %if &dsid %then     %do;        %let fmt=%sysfunc(varlabel(&dsid,                          %sysfunc(varnum                                  (&dsid,NAME))));        %let rc=%sysfunc(close(&dsid));     %end; 
end example
 

See Also

Functions:

  • 'OPEN Function' on page 690

  • 'VARNUM Function' on page 877




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