Chapter Contents |
Previous |
Next |
VARLIST |
Category: | SAS Table |
Syntax | |
Details | |
Examples | |
See Also |
Syntax |
selections=VARLIST(table-id,var-type,num-sel<,message <,autoclose<,sel-order<,exclude<,select>>>>>); |
Type: Character
Type: Numeric
'C' |
The list contains only character columns. |
'N' |
The list contains only numeric columns. |
'A' |
The list contains all of the columns. (This is the default.) |
Type: Character
0
. To specify an unlimited
number of 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.
Type: Numeric
Type: Character
"
as a placeholder for this
argument.
Type: Character
"
as a placeholder.
Type: Character
Type: Character
Type: Character
Details |
VARLIST opens a dialog window in which a user can select columns from a SAS table. The columns specified in the VARLIST function are listed in the Available list. To make a selection, a user selects one or more columns and then presses the arrow control that points to the Selected list. The selected values move to the Selected list and are removed from the Available list. The Variable Details fields display the type, length, and description of a selected column.
For each column in the table, VARLIST uses the following steps to determine which columns to display:
You can provide default values that will be initially selected when the column selection list is displayed. To do this, assign the column name to the selections variable before calling VARLIST. When the window opens, the column name appears in the Selected list.
If a user closes the dialog window without making a selection, VARLIST returns a blank value unless there was an initial value for the selections column before VARLIST was called.
The values for all selections 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 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 VARLIST function. You can use GETITEMC to retrieve these selections.
Examples |
select=varlist(dsid,'a',1);
select=varlist(dsid,'c',2,'Choose a column', '','','name address');
listid=makelist(); rc=curlist(listid); select=varlist(dsid,'c',2, 'Choose a column','',",'name address'); n=listlen(listid); do i=1 to n; varname=getitemc(listid,i); put varname=; end;
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.