Chapter Contents |
Previous |
Next |
MAKENLIST |
Category: | List |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
list-id=MAKENLIST(visibility,name-1<, . . . ,name-n>); |
Type: Numeric or List
'G' |
The list is global and can be shared by all applications executing in the same SAS session. A global list is deleted when the SAS session ends. |
'L' |
The list is local to the current SAS application. A local list is deleted when the application ends. (This is the default.) |
Type: Character
Type: Character
Details |
MAKENLIST creates a list that contains an item for each name that you specify. Each item contains a missing value. Use the list identifier returned by MAKENLIST with all remaining functions that manipulate the list. When you create a list of named items, you can assign or access list values by their names as well as by their positions. However, it is more efficient to access items by position rather than by name.
You can use MAKENLIST to create structures that group related information into one list. For example, a row in a SAS table can be placed in a named list where each named item corresponds to the table column of the same name.
Note that the visibility argument (L or G) is required and is the first argument, unlike the MAKELIST function. Note also that this function does not use an n argument.
Using MAKENLIST is simpler than using MAKELIST and then naming each item independently.
Example |
The following statement creates a list of four named items:
mylist=makenlist('L','A','B','C');It is equivalent to these four statements:
mylist=makelist(3,'L'); rc=nameitem(mylist,1,'A'); rc=nameitem(mylist,2,'B'); rc=nameitem(mylist,3,'C');
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.