SAS Component Language Dictionary |
Category: | List |
Syntax | |
Details | |
See Also |
Syntax |
rc=DELLIST(list-id<,recursively>); |
contains the return code for the operation:
0 | |
0 |
is the identifier of the list to be deleted. An invalid list-id produces an error condition.
specifies whether to recursively delete all the list's sublists and all sublists of its sublists.
'N' | |
'Y' |
Details |
A list's contents cannot be retrieved after the list is deleted.
If recursively is 'Y', DELLIST recursively deletes all sublists that do not have the NODELETE attribute. For sublists that have the NODELETE attribute, the sublist identifiers are removed from the deleted list, but the sublist is not deleted. Thus, you should store list identifiers for sublists either in another list or in an SCL variable so that you can access the lists later. All local lists that are not explicitly deleted are deleted when the application ends, at the same time that SCL closes open tables and files.
Recursively deleting a list deletes all of its sublists even if they are referenced in other SCL lists or by other SCL variables. If you do not want a list to be deleted when it is a sublist item in a deleted list, use SETLATTR to assign the NODELETE attribute to the sublist. See SETLATTR for a discussion of the NODELETE attribute.
To conserve memory, delete lists when they are no longer needed. Typically, a DELLIST statement is placed in the termination section (TERM or FSETERM) of the program. Although the program that creates a list is most often responsible for deleting the lists that it creates, it does not have to delete them unless that is the appropriate action for the application; it may return the list that it created to its caller.
The list is not deleted, and a non-zero value is returned to rc, if
the list is the local or global environment list (the lists returned by the ENVLIST function)
list-id is a component identifier or a class list identifier.
To check attributes, use HASATTR. To change attributes, use SETLATTR.
If DELLIST fails because of a condition listed above, the list and/or sublists may be partially cleared, and no further items or sublists are cleared.
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.