Previous Page | Next Page

SAS Component Language Dictionary

REVLIST



Reverses the order of the items in an SCL list
Category: List

Syntax
Details
Example
See Also

Syntax

list-id=REVLIST(list-id);

list-id

is the identifier of the list to reverse. The function returns the list identifier that is passed in. An invalid list-id produces an error condition.

Type: Numeric or List


Details

Any names and attributes that are assigned to list items remain with the items when the items are reversed.

REVLIST does not make a copy of the list before reversing the order of the list items. The list is modified in place. To keep a copy of the original list, use COPYLIST before REVLIST.

An error condition results if the list has the NOUPDATE attribute.

To check attributes, use HASATTR. To change attributes, use SETLATTR.


Example

Make a nonrecursive copy of the list identified by MYLISTID, reverse the items in the copied list, and assign the new list identifier to the variable REVLISTID:

revlistid = revlist(copylist(mylistid));


See Also

HASATTR

ROTLIST

SETLATTR

SORTLIST

Previous Page | Next Page | Top of Page