Use the LIBNAME statement to read
from and write to a DBMS object as if it were a SAS data set. After
connecting to a DBMS table or view by using the LIBNAME statement,
you can use PROC SQL to interact with the DBMS data.
For many DBMSs, you
can directly access DBMS data by assigning a libref to the DBMS by
using the
SAS/ACCESS LIBNAME
statement. Once you have associated a libref with the DBMS, you can
specify a DBMS table in a two-level SAS name and work with the table
like any SAS data set. You can also embed the LIBNAME statement in
a PROC SQL view. For more
information, see the
CREATE VIEW Statement.
PROC SQL takes advantage
of the capabilities of a DBMS by passing it certain operations whenever
possible. For example, before implementing a join, PROC SQL checks
to determine whether the DBMS can perform the join. If it can, then
PROC SQL passes the join to the DBMS, which enhances performance by
reducing data movement and translation. If the DBMS cannot perform
the join, then PROC SQL processes the join. Using the
SAS/ACCESS LIBNAME statement can often provide
you with the performance benefits of the SQL procedure pass-through
facility without writing DBMS-specific code.
Note: You can use the DBIDIRECTEXEC
system option to send a PROC SQL CREATE TABLE AS SELECT statement
or a DELETE statement directly to the database for execution, which
could result in CPU and
I/O performance improvement. For more information,
see the
SAS/ACCESS documentation for your DBMS.
To use the
SAS/ACCESS LIBNAME statement, you must have
SAS/ACCESS software installed
for your DBMS. For more information about the
SAS/ACCESS LIBNAME statement, see the
SAS/ACCESS documentation for your DBMS.