Chapter Contents |
Previous |
Next |
GETVARN |
Category: | SAS File I/O |
Syntax | |
Arguments | |
Details | |
Examples | |
See Also |
Syntax |
GETVARN(data-set-id,var-num) |
Tip: | You can obtain this value by using the VARNUM function. |
Tip: | This value is listed next to the variable when you use the CONTENTS procedure. |
Details |
Use VARNUM to obtain the number of a variable in a SAS data set. You can nest VARNUM or you can assign it to a variable that can then be passed as the second argument, as shown in the "Examples" section. GETVARN reads the value of a numeric variable from the current observation in the Data Set Data Vector (DDV) into a macro variable or DATA step variable.
Examples |
%let rc=%sysfunc(fetchobs(&mydataid,10)); %let price=%sysfunc(getvarn(&mydataid, %sysfunc(varnum (&mydataid,price))));
%let pricenum=%sysfunc(varnum (&mydataid,price)); %let rc=%sysfunc(fetchobs(&mydataid,10)); %let price=%sysfunc(getvarn (&mydataid,&pricenum));
See Also |
Functions:
|
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.