Chapter Contents

Previous

Next
Data Set Data Model: _setWhere

Data Set Data Model: _setWhere



Sets a WHERE clause on the table


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

The WHERE window does not support nliteral column names.



'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. For more information on the WHERE window, see SAS Guide to the SQL Query Window: Usage and Reference, Version 6, First Edition, or online, open the SQL Query Window and select Help.

Note:   The _setWhere method may be called from the model's SCL entry, but the WHERE statement's application will be suspended until the label finishes executing.  [cautionend]


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.