Chapter Contents

Previous

Next
SUBSET

SUBSET



Adds or modifies selection criteria for a view descriptor.

Optional statement
Applies to: view descriptor


Syntax
Details

Syntax

SUBSET selection-criteria;

Details

You use the SUBSET statement to specify selection criteria when you create a view descriptor. This statement is optional; if you omit it, the view retrieves all the data (that is, all the rows) in the DBMS table.

An editing statement, such as SUBSET, must follow the CREATE or UPDATE statement when you create or update a view descriptor. See CREATE for more information on the order of statements.

The selection-criteria argument can be one or more DBMS-specific SQL expressions that are accepted by your DBMS, such as WHERE, ORDER BY, HAVING, and GROUP BY. You use DBMS column names, not SAS variable names, in your selection criteria. For example, for a view descriptor that retrieves rows from a DBMS table, you could submit the following SUBSET statement:

subset where firstorder is not null;

If you have multiple selection criteria, enter them all in one SUBSET statement, as in the following example:

subset where firstorder is not null
  and country = 'USA'
  order by country;

Unlike other ACCESS procedure statements, the SUBSET statement may be case sensitive. The SQL statement is sent to the DBMS exactly as you type it. Therefore, you must use the correct case for any DBMS object names. See your DBMS chapter for details.

The SAS System does not check the SUBSET statement for errors. The statement is verified only when the view descriptor is used in a SAS program.

If you specify more than one SUBSET statement per view descriptor, the last SUBSET overwrites the earlier SUBSETs. To delete the selection criteria, submit a SUBSET statement without any arguments.


Chapter Contents

Previous

Next

Top of Page

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