SAS/ACCESS Interface to CA-DATACOM/DB: 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 better to extract CA-DATACOM/DB data
and place them in a SAS data file than to read them directly. Here are some
circumstances when you should probably extract:
- If you plan to use the same CA-DATACOM/DB data
in several procedures in the same session, you may improve performance by
extracting the CA-DATACOM/DB data.
Placing these data in a SAS data file requires a certain amount of disk space
to store the data and I/O to write the data. However, SAS data files are
organized to provide optimal performance with PROC and DATA steps. Programs
using SAS data files often use less CPU time than when they read CA-DATACOM/DB data
directly.
- If you plan to read large amounts of data from
a CA-DATACOM/DB table and the data
are being shared by several users (Multi-User environment), your direct reading
of the data could adversely affect all users' response times.
- If you are the creator of a table, 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 more efficient to run the SORT procedure
on the view descriptor, using the OUT= option than to request the same sort
repeatedly (with a SORT clause) on the CA-DATACOM/DB 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, or with a SORT clause
included in the view descriptor. When you use a SAS BY statement with a view
descriptor, it is most efficient to use a BY column that is associated with
an indexed CA-DATACOM/DB field. Also,
if you do not need a certain order, blank out the Default Key. Otherwise,
you may cause an unnecessary sort.
- If you use a Default Key, the interface view engine
will use an index read instead of a sort if it can. Index reads are faster,
but not always possible. For example, an index read is not possible if you
specify multiple sort keys, multiple WHERE clause conditions, or a WHERE clause
condition with a column that is not a key.
- When you are writing a SAS program and referencing
a view descriptor, it is more efficient to use a WHERE statement in the program
than it is to use a subsetting IF statement. The interface view engine passes
the WHERE statement as CA-DATACOM/DB selection
criteria to the view descriptor, connecting it (with the AND operator) to
any WHERE clause included in the view descriptor. Applying a WHERE clause
to the CA-DATACOM/DB data may reduce
the number of records processed, which often improves performance.
- You can provide your own URT with options that
are fine-tuned for your applications.
- 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.