SAS Component Language Dictionary |
Category: | List |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
rc=CLEARLIST(list-id<,recursively>); |
indicates whether the operation is successful:
0 | |
0 |
is the identifier of the list that contains the items to clear. An invalid list-id produces an error condition.
indicates whether to recursively clear all the list's sublists as well as all sublists of its sublists.
'D' |
Clears and deletes sublists recursively. |
'N' | |
'Y' |
Details |
CLEARLIST clears all the items from the SCL list identified by list-id. The list is not deleted, but its length is reduced to 0. If recursively is 'Y', then all the list's sublists, including sublists of sublists, are also cleared.
The recursively option clears all of a list's sublists, even if they are referenced in other SCL lists or by other SCL variables.
any item in the list (or in its sublists, if recursively is 'Y') has the NODELETE attribute.
recursively is 'Y', and any sublist has the NOUPDATE or FIXEDLENGTH attribute.
If an error condition results, no further items or sublists are cleared.
Example |
Clear all sublists from an existing list identified by MYLIST without deleting items that are not sublists:
/* Copy the list. */ cp=copylist(mylist); /* Clear the entire list, including sublists */ /* that also appear in CP. */ rc=clearlist(mylist,'Y'); /* Copy the old list data. */ /* Sublists have been cleared. */ mylist=copylist(cp,'N',mylist); /* Delete the copied list. */ rc=dellist(cp);
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.