CALL LABEL Routine


Assigns a variable label to a specified character variable

Category: Variable Control

Syntax

CALL LABEL ( variable-1 , variable-2 );

Arguments

variable-1

  • specifies any SAS variable. If variable-1 does not have a label, the variable name is assigned as the value of variable-2 .

variable-2

  • specifies any SAS character variable. Variable labels can be up to 256 characters long; therefore, the length of variable-2 should be at least 256 characters to avoid truncating variable labels.

  • Note: To conserve space, you should set the length of variable-2 to the length of the label for variable-1 , if it is known.

Details

The CALL LABEL routine assigns the label of the variable-1 variable to the character variable variable-2 .

Examples

This example uses the CALL LABEL routine with array references to assign the labels of all variables in the data set OLD as values of the variable LAB in data set NEW:

 data new;     set old;        /* lab is not in either array */     length lab 6;        /* all character variables in old */     array abc{*} _character_;        /* all numeric variables in old */     array def{*} _numeric_;     do i=1 to dim(abc);           /* get label of character variable */        call label(abc{i},lab);           /* write label to an observation */        output;     end;     do j=1 to dim(def);           /* get label of numeric variable */        call label(def{j},lab);           /* write label to an observation */        output;     end;     stop;     keep lab;  run; 

See Also

Function:

  • 'VLABEL Function' on page 902




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