SAS/ACCESS Interface to SYSTEM 2000 Data Management Software: Reference |
While you
can generally treat view descriptors like SAS data
files in SAS programs, there are a few things you should keep in mind:
- It is sometimes best to extract SYSTEM 2000 data
and place them in a SAS data file rather than to read them directly. Here
are some circumstances when you should probably extract:
- If you plan to use the same SYSTEM 2000 data in
several procedures over a period of time, you may improve performance by
extracting. SAS data files are organized to provide optimal performance with
PROC and DATA steps. SAS programs using SAS data files often use less CPU
time than when they directly read SYSTEM 2000 data.
- If you plan to read large amounts of data from
a large SYSTEM 2000 database and the database is being shared by several users
(Multi-User environment), your direct reading of the data could adversely
affect all users' response time.
- If you are the owner of a database, and you think
that directly reading this data would present a security risk, you may want
to extract the data and not distribute information about either the access
descriptor or view descriptor.
- If you intend to use the data in a particular
sorted order several times, it is usually best to run the SORT procedure on
the view descriptor, using the OUT= option. This is more efficient than requesting
the same sort repeatedly (with an ORDER BY clause) on the SYSTEM 2000 data.
Note that you cannot run the SORT procedure on a view descriptor unless you
use the SORT procedure's OUT= option.
- Sorting data can be resource-intensive, whether
it is done with the SORT procedure, with a BY statement (that generates an
ordering-clause), or with an ordering-clause included in the view descriptor.
You should sort data only when it is needed for your program.
- If you reference a view descriptor in SAS code
and the code includes a BY statement for a variable that corresponds to an
item in the SYSTEM 2000 database, the interface view engine automatically
generates an ordering-clause for that variable. Thus, the ordering-clause
sorts the SYSTEM 2000 data before it uses the data in your SAS program. If
the SYSTEM 2000 database is very large, this sorting can affect performance.
If the view descriptor already has an ordering-clause
and you specify a BY statement in your SAS code, the BY statement overrides
the view descriptor's ordering-clause. When you use a SAS BY statement with
a view descriptor, it is most efficient to use a BY variable that is associated
with an indexed SYSTEM 2000 item.
- When writing SAS code and referencing a view descriptor,
it is more efficient to use a WHERE statement in the code than it is to use
a subsetting IF statement. The interface view engine passes the WHERE statement
as a SYSTEM 2000 where-clause to the view descriptor, connecting it (using
a Boolean AND) to any where-clause included in the view descriptor. (You can
further optimize the selection criteria by using connecting strings. See Connecting Strings. Applying
a WHERE clause to the SYSTEM 2000 data may reduce the number of entries processed,
which often improves performance.
Refer to Creating and Using View Descriptors Efficiently
for more details on creating efficient view descriptors.
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.