Chapter Contents |
Previous |
Next |
FILELIST |
Category: | Selection List |
Syntax | |
Details | |
Examples | |
Example 1: Displaying Specified Filerefs | |
Example 2: Using a Current Result List for Multiple User Selections | |
See Also |
Syntax |
selections=FILELIST(<sel-excl<,message<,autoclose <,num-sel>>>>); |
Type: Character
'*'
)
or a null string (''
) to display all the filerefs
that are defined for the current SAS session.
Type: Character
Type: Character
"
as a placeholder for this argument.
Type: Character
Type: Numeric
Details |
The selection list displays both filerefs and the corresponding physical names of the external files to which the filerefs are assigned, but only the selected fileref is returned.
If you omit all the arguments for FILELIST (for example,
selections=filelist();
), the
selection list window contains all filerefs that have been assigned in the
current SAS session.
You can provide default values that will be initially selected when the fileref selection list is displayed. To do this, assign the values to the selections variable before calling FILELIST.
If a user closes the selection list window without making a selection, FILELIST returns a blank value unless there was an initial value for the selections variable before FILELIST 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 FILELIST function.
When FILELIST is invoked, the current result list is cleared. After FILELIST is invoked, the current result list contains the following named items:
Type: Character
Type: Numeric
Type: Character
Type: Character
Because some engines support mixed-case filenames, FILELIST now retains the cases of the returned selected items. This may cause your application to fail if your application contains code that assumes the returned selection is uppercased. For example,
if (filelist(dsid, 'TESTNDX')='NDXVAR')must be changed to
if (upcase(filelist(dsid, 'TESTNDX'))='NDXVAR'If the application cannot be modified, you may need to specify the VALIDVARNAME=V6 system option when you run the application to ensure that the selections returned from the FILELIST function will be uppercased.
Examples |
Open a window that displays a list of all defined filerefs except for LISTNUM.
select=filelist('^listnum');
Open a window that displays a list of all defined filerefs except LISTNUM. Users can make up to five selections. The selections are retrieved from the current result list.
listid=makelist(); rc=curlist(listid); select=filelist('^listnum',' ',' ',5); n=getnitemn(listid,'COUNT'); do i=1 to n; fileref=getnitemc(listid,'FILEREF',i); physname=getnitemc(listid,'FILENAME',i); put fileref= physname=; end;
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.