Chapter Contents

Previous

Next
Data Form and Data Table: _setWhere

Data Form and Data Table: _setWhere



Sets a WHERE clause on the table

Delegated to: Data Set Data Model class


Syntax
Details
Example

Syntax

CALL SEND (object-id, '_setWhere', where-list<, prompt>);

Argument Type Description
where-list
N specifies the identifier of an SCL list that contains the WHERE clause(s) to apply to the table. If you specify 'Y' for prompt, you can specify 0 as the list.
prompt
C specifies whether the model should display an interactive WHERE window with which the user can create WHERE clauses.


'Y' displays an interactive WHERE window


'N' does not display an interactive WHERE window


Details

The _setWhere method imposes one or more sets of conditions that rows in the table must meet in order to be displayed. Rows that do not satisfy the specified conditions cannot be displayed or edited.

If you use the _addRow or _copyRow command to add a new row and enter values that do not meet the WHERE conditions, the row cannot be displayed or edited once it is written to the table while the WHERE clause is in effect.

An empty list or a list with the single item 'CLEAR' clears the current WHERE clause.

The _setWhere method cannot be used with _setKey.

The _setWhere method sets SYSRC for error, note, and warning conditions.

If you augment a WHERE clause, the SCL list containing the augmentation must begin with ALSO.

If you use the interactive WHERE window to specify a WHERE clause, the WHERE clause is automatically applied when the user exits from the WHERE window.


Example

The following example assumes you have created a frame with a data table named TABLE and a push button object named BUTTON1.

 Note about code
INIT:
   call notify('.', '_getWidget', 'TABLE', tabid);
   call send(tabid, '_setDataset', 'sasuser.class');
return;
 Note about code
BUTTON1:
   listid=makelist();
   listid=insertc(listid, "Sex='M'" ,-1);
   listid=insertc(listid, "and weight > 50", -1);
   call putlist(listid, 'WHERE clause', 0);
   call send(tabid, '_setWhere', listid);
   rc=clearlist(listid);
 Note about code
   listid=setnitemc(listid, ' ', 'WHERE_LIST');
   call send(tabid, '_getDatasetAttributes',
             listid);
   call putlist(listid, 'Where List', 0);
   listid=dellist(listid);
return;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.