SAS Component Language Dictionary |
Returns the length of a SAS table column
length=VARLEN(table-id,var-num);
|
-
length
-
contains the length of the column.
Type: Numeric
-
table-id
-
is the identifier that was assigned
when the table was opened. If table-id is invalid,
the program halts.
Type: Numeric
-
var-num
-
is the number of the column in the
SAS table. This number is adjacent to the column in the list that is produced
by the CONTENTS procedure. The VARNUM function returns this number.
Type: Numeric
Obtain the length of the column ADDRESS
in the SAS table MYDATA:
dsid=open('mydata','i');
if dsid then
do;
namelen=varlen(dsid,varnum(dsid,'address'));
rc=close(dsid);
end;
VARNUM
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.