SAS Component Language Dictionary |
Category: | SAS Table |
Syntax | |
Styles of Name Specification | |
Details | |
Examples | |
See Also |
Syntax |
selections=LIBLIST(<sel-excl<,engine<,message <,autoclose<,num-sel>>>>>); |
contains one or more librefs from the list, or blank if no selection is made. Multiple selections are separated by blanks. By default, selections is 200 bytes long. To accommodate values longer than 200 bytes, explicitly declare selections with a longer length.
is one or more librefs to include or exclude from the selection list window. Specify names using a style described in Styles of Name Specification.
is one or more engines to use as criteria for determining which librefs are displayed. Specify names using a style described in Styles of Name Specification.
is the text for a message to display above the selection list. The default message tells users to make up to the number of selections in num-sel.
is an obsolete argument but is retained for compatibility with earlier releases. If you want to specify a value for num-sel, then specify ' ' as a placeholder for this argument.
specifies the maximum number of items a user can select from the list. To display the list for information purposes only (no selections allowed), specify 0. To specify unlimited selections, use a value such as 9999 that is larger than the number of available selections. A user cannot make a number of selections that exceeds the number of items in the list.
Styles of Name Specification |
To specify more than one name, separate the names with a space -- for example, MYLIB1 MYLIB2.
To specify all names, use an asterisk ('*') or a null string ('').
To specify all names except those listed after the NOT sign, use a NOT sign (¬ or ^) followed by one or more names. For example, ^MYLIB1 displays all defined librefs except MYLIB1.
Details |
LIBLIST opens the Library Selector window, which lists librefs, engines, and the physical names of the operating system files. However, only the selected libref is returned. The window contains a Browse button which a user can select to display the SAS Explorer window and select from the librefs that are currently assigned and their contents. After browsing data libraries, a user can select File Close to return to the Library Selector window.
If you omit all the arguments for LIBLIST (for example, selections=liblist(); ), the selection list window lists all librefs that have been assigned in the current SAS session.
You can provide a default value that will be initially selected when the libref selection list is displayed. To do this, assign the value to the selections variable before calling LIBLIST.
If a user closes the selection list window without making a selection, LIBLIST returns a blank value unless there was an initial value for selections before LIBLIST was called.
Selections from the window can be returned in the current result list, if one is available. The current result list is a special SCL list that is automatically filled with the values that are selected from a selection list. To use a current result list, use the MAKELIST function to create the list, and use the CURLIST function to designate it as the current result list. The current result list must exist before you call the LIBLIST function.
When LIBLIST is invoked, the current result list is cleared. After LIBLIST is invoked, the result list contains the following named items:
identifies the list as one that was created by the LIBLIST function.
contains the number of selected librefs, or 0 if a user makes no selections or issues a CANCEL command in the list window.
contains the name of each selected libref. There is one LIBREF element for each selected libref name.
contains the physical name of the operating system file for each selected libref. There is one LIBNAME element for each selected libref.
Examples |
Create a selection list that displays all librefs except MYLIB1 and MYLIB2, and display the message 'Choose a libref'.
select=liblist('^mylib mylib2','*',Choose a libref');
Create a selection list that displays all librefs associated with the V609 engine, and exclude the librefs SASHELP and MAPS. Allow users to make up to three selections.
select=liblist('^sashelp maps','v609', 'Choose up to 3 librefs','',3);
Create a current result list to receive user selections. Use MAKELIST to create the list and CURLIST to define it as the current result list. Display all librefs except MYLIB1 and MYLIB2, and allow users to make up to five selections. Use a DO loop to retrieve the selections from the current result list.
listid=makelist(); rc=curlist(listid); select=liblist('^ mylib1 mylib2',' ', 'Choose up to 5 librefs','', 5); n=getnitemn(listid,'COUNT'); do i=1 to n; libref=getnitemc(listid,'LIBREF',i); physname=getnitemc(listid,'LIBNAME',i); put libref= physname=; end;
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.