SAS Component Language Dictionary |
Category: | List |
Syntax | |
Details | |
Examples | |
Example 1: Using the GETITEMC Function | |
Example 2: Using the GETITEML Function | |
Example 3: Using the GETITEMN Function | |
Example 4: Using the GETITEMO Function | |
See Also |
Syntax |
cval=GETITEMC(list-id<,index>); |
sublist-id=GETITEML(list-id<,index>); |
nval=GETITEMN(list-id<,index>); |
object-id=GETITEMO(list-id<,index>); |
contains the character value (returned by GETITEMC) of the item that is stored at the specified position in list identified by list-id.
contains the list identifier (returned by GETITEML) of the sublist that is stored at the specified position in the list identified by list-id.
contains the numeric value (returned by GETITEMN) of the item that is stored at the specified position in the list identified by list-id.
contains the object identifier (returned by GETITEMO) of the object that is stored at the specified position in the list identified by list-id.
contains the identifier of the list that you want to query. An invalid list-id produces an error condition.
is the position in the list of the item to return. The position can be specified as a positive or negative number. By default, index is 1 (the first item). If index is a positive number, then the item is at position index from the beginning of the list. If index is a negative number, then the item is at position ABS(index) from the end of the list. An error condition results if the absolute value for index is zero or if it is greater than the number of items in the list.
Details |
An error results if you use any of these functions to return an indexed item that has a different data type. You can determine the data type of an item in a list by using ITEMTYPE before using GETITEMC, GETITEML, GETITEMN, or GETITEMO.
Examples |
Return the character values stored in the first and third items of the list identified by the MYLIST variable:
citem=getitemc(mylist); citem=getitemc(mylist,3);
Return the list identifier stored in the eighth item of the list identified by the MYLIST variable:
slist=getiteml(mylist,8);
Return the numeric value stored in the fifth item of the list identified by the MYLIST variable:
nitem=getitemn(mylist,5);
Return the object identifiers stored in the third and ninth item of the list identified by the MYLIST variable:
sublist=getitemo(mylist,3); oitem=getitemo(mylist,9);
See Also |
GETNITEMC, GETNITEML, GETNITEMN, and GETNITEMO
SETITEMC, SETITEML, SETITEMN, and SETITEMO
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.