Chapter Contents

Previous

Next
NAMEITEM

NAMEITEM



Returns and optionally replaces the name of an item in an SCL list

Category: List


Syntax
Details
See Also

Syntax

item-name=NAMEITEM(list-id<,index<,new-name>>);

item-name
contains the name of the specified list item, or a blank if the item does not have a name.

Type: Character

list-id
is the identifier of the list that contains the indexed item. An invalid list-id produces an error condition.

Type: Numeric or List

index
is the position of the item in the list. 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.

Type: Numeric

new-name
is the new name to assign to the list item.

Type: Character


Details

NAMEITEM returns the name of the item at the list position specified by index. If a value for new-name is also provided, then NAMEITEM assigns that name to the item, replacing the old name.

An error condition results if the value for new-name is provided and the list has any of the following attributes:

To check the attributes of a list or list item, use HASATTR. To change attributes, use SETLATTR.

See Also

DELNITEM

NAMEDITEM


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.