SAS Component Language Dictionary |
Returns the label that is assigned to a SAS table column
cval=VARLABEL(table-id,var-num);
|
-
cval
-
contains the label that is assigned
to the specified column.
Type: Character
-
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
If no label has been assigned to the column,
a blank string is returned.
Obtain the label of the column NAME in
the SAS table MYDATA:
length lab $ 40;
dsid=open('mydata','i');
if dsid then
do;
lab=varlabel(dsid,varnum(dsid,'name'));
rc=close(dsid);
end;
VARNUM
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.