Previous Page | Next Page

SAS Component Language Dictionary

VARLEN



Returns the length of a SAS table column
Category: Variable

Syntax
Example
See Also

Syntax

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


Example

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;


See Also

VARNUM

Previous Page | Next Page | Top of Page