Chapter Contents

Previous

Next
SAS/ACCESS Interface to SYSTEM 2000 Data Management Software: Reference

Selecting a Subset of Data

A database wouldn't be very efficient if all logical entries had to be accessed when you needed data from only some of them. Therefore, SYSTEM 2000 software allows you to specify a where-clause to identify those parts of the database that are relevant to your query or update.

A where-clause lets you select a subset of values by specifying conditions that values must meet. A where-clause consists of the keyword WHERE (or WH) and one or more conditions. Typically, a condition consists of a schema item, an operator, and a value or a range of values, as illustrated in these examples:

    WHERE ACCRUED VACATION EXISTS
    WHERE SEX EQ MALE
    WHERE BIRTHDAY SPANS 01/01/1949 * 12/31/1949
    WHERE STREET ADDRESS CONTAINS /RIM ROCK/

You can also combine conditions using connector operators to form expressions, as illustrated in the following example:

    WHERE SKILL TYPE = COBOL AND 
    YEARS OF EXPERIENCE = 4

For the SAS/ACCESS interface to SYSTEM 2000 software, you can include a SYSTEM 2000 where-clause in a view descriptor to specify selection criteria. In addition to or instead of a where-clause, you can specify selection criteria in a SAS program using a SAS WHERE clause.

Note that the SYSTEM 2000 where-clause and the SAS WHERE clause have some differences. For example, in a SYSTEM 2000 where-clause, the date format (by default) is MM/DD/YYYY, and you do not have to include single quotes around character literals.

For more information on SYSTEM 2000 where-clauses and a description of the syntax, see SYSTEM 2000 Where-Clause. For more information on using a SAS WHERE clause, see Using a SAS WHERE Clause for Selection Criteria and Connecting Strings.


Chapter Contents

Previous

Next

Top of Page

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