Previous Page | Next Page

SAS Component Language Dictionary

VARLIST



Displays a dialog window that lists the columns in a SAS table, and returns the user's selections
Category: SAS Table

Syntax
Details
Examples
See Also

Syntax

selections=VARLIST(table-id,var-type,num-sel<,message <,autoclose<,sel-order<,exclude<,select>>>>>);

selections

contains one or more user selections from the list, or a 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.

Type: Character

table-id

is the identifier that was assigned when the table was opened. If table-id is invalid, the program halts.

Type: Numeric

var-type

specifies the data type of the columns to display in the list:

'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

num-sel

is the maximum number of items a user can select from the list. The default is 1. To display the list for information purposes only (no selections allowed), specify 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

message

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 specified in num-sel.

Type: Character

autoclose

is an obsolete argument but is retained for compatibility with earlier releases. If you want to specify a value for sel-order, exclude, or select, then specify " as a placeholder for this argument.

Type: Character

sel-order

is an obsolete argument but is retained for compatibility with earlier releases. If you want to specify a value for exclude or select, then you must specify " as a placeholder.

Type: Character

exclude

lists one or more columns to exclude from the selection list. Separate multiple columns with at least one blank.

Type: Character

select

lists one or more columns to select for the selection list. Separate multiple columns with at least one blank.

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


See Also

DATALISTC and DATALISTN

LISTC and LISTN

SHOWLIST

Previous Page | Next Page | Top of Page