Previous Page | Next Page

SAS Component Language Dictionary

IVARLIST



Returns the column names for an index key
Category: SAS Table

Syntax
Details
Example
See Also

Syntax

varlist=IVARLIST(table-id,key-name);

varlist

contains one or more index columns (separated by a blank) for the specified key, or a blank if key-name is invalid.

Type: Character

table-id

contains the identifier that was assigned when the table was opened. If table-id is invalid, the program halts.

Type: Numeric

key-name

is the name of an index key.

Type: Character


Details

An index is an auxiliary data structure used to speed up the selection of records that are specified by the value of a column.

An index is called a simple index if it contains the value of only one column. A composite index merges the values for more than one column to form a single value. A given SAS table can have multiple simple indexes, composite indexes, or a combination of these.

You can create indexes using

Note:    Because some engines now support mixed-case filenames, IVARLIST now retains the cases of the returned selected items. If your application contains code that assumes that the returned selection is in uppercase, your application may fail. You may need to modify your application. For example, you can use the UPCASE (footnote 1) function to convert the returned selection to uppercase:

if (upcase(ivarlist(dsid, 'TESTNDX'))='NDXVAR'

If the application cannot be modified, you may need to specify the VALIDVARNAME=V6 system option when you run the application to ensure that the selections returned from the IVARLIST function are in uppercase.  [cautionend]


Example

Return the column list that is indexed for the key ITEMTYPE in the SAS table MYLIB.DATAONE. Assume that ITEMTYPE is a simple index (that is, it contains the values of only one column). The returned VARLIST contains the string ITEMTYPE.

tableid=open('mylib.dataone','i');
varlist=ivarlist(tableid,'itemtype');


See Also

VALIDVARNAME system option in SAS Language Reference: Dictionary

ICREATE

IDELETE

IOPTION

ISINDEX


FOOTNOTE 1:   For documentation for the UPCASE function, refer to SAS Language Reference: Dictionary. [arrow]

Previous Page | Next Page | Top of Page