Previous Page | Next Page

SAS Component Language Dictionary

VARFMT



Returns the format that is assigned to a SAS table column
Category: Variable

Syntax
Details
Example
See Also

Syntax

format=VARFMT(table-id,var-num);

format

contains the format that was 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's position 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


Details

If no format has been assigned to the column, a blank string is returned.


Example

Obtain the format of the column NAME in the SAS table MYDATA:

length fmt $ 12;
dsid=open('mydata','i');
if dsid then
   do;
      fmt=varfmt(dsid,varnum(dsid,'name'));
      rc=close(dsid);
   end;


See Also

VARINFMT

VARNUM

Previous Page | Next Page | Top of Page