Chapter Contents

Previous

Next
SAS/ACCESS Interface to CA-DATACOM/DB: Reference

Selecting a Subset of Data

A database would not be very efficient if all records had to be accessed when you needed data from only some of them. Therefore, you can specify selection criteria to identify those parts of the CA-DATACOM/DB table that you want to access.

Selection criteria contain one or more conditions that values must meet. Typically, a condition consists of a field name, an operator, and a value, but you can also compare the values of two fields or give a range of values. Conditions can be combined with AND (&) or OR (|).

Here are some sample conditions.

cost<.50
lastname eq 'Smith'

part=9567 & onhand>2.0e+6

For the SAS/ACCESS interface to CA-DATACOM/DB, you can include a WHERE clause in a view descriptor to specify selection criteria or you can include a SAS WHERE clause in a SAS program. Or you can include both WHERE clauses. The interface view engine translates WHERE clauses into CA-DATACOM/DB selection criteria.

Note that the WHERE clause for a view descriptor and the SAS WHERE clause have some differences. For more information on WHERE clauses and a description of the syntax, see WHERE Clause in a View Descriptor and Deciding How to Specify Selection Criteria.


Chapter Contents

Previous

Next

Top of Page

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