CALL VNAME Routine


Assigns a variable name as the value of a specified variable

Category: Variable Control

Syntax

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

Arguments

variable-1

  • specifies any SAS variable.

variable-2

  • specifies any SAS character variable. Because SAS variable names can contain up to 32 characters , the length of variable-2 should be at least 32.

Details

The CALL VNAME routine assigns the name of the variable-1 variable as the value of the variable-2 variable.

Examples

This example uses the CALL VNAME routine with array references to return the names of all variables in the data set OLD:

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

See Also

Functions:

  • 'VNAME Function' on page 906

  • 'VNAMEX Function' on page 907




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