Chapter Contents |
Previous |
Next |
VARNUM |
Category: | Variable |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
var-num=VARNUM(table-id,var-name); |
Type: Numeric
Type: Numeric
Type: Character
Details |
VARNUM returns the number of a SAS table column.
Example |
Obtain the number of a column in the SAS table MYDATA, using the value of the NAME variable:
tableid=open('mydata','i'); if (sasname(name)) then do; citynum=varnum(tableid,name); if (citynum=0) then _msg_='The column is not in the table.'; else _msg_='The column number is '|| citynum; end; else _msg_='Invalid SAS name--please reenter.';
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.