A SERVICE OF

logo

The LIBNAME Statement for Relational Databases LIBNAME Statement Syntax for Relational Databases 65
Syntax
u LIBNAME libref engine-name
<SAS/ACCESS-connection-options>
<SAS/ACCESS-LIBNAME-options>;
v LIBNAME libref CLEAR|_ALL_ CLEAR;
w LIBNAME libref LIST|_ALL_ LIST;
Arguments
The SAS/ACCESS LIBNAME statement takes the following arguments:
libref
is any SAS name that serves as an alias to associate SAS with a database, schema,
server, or group of tables and views. Like the global SAS LIBNAME statement, the
SAS/ACCESS LIBNAME statement creates shortcuts or nicknames for data storage
locations. While a SAS libref is an alias for a virtual or physical directory, a
SAS/ACCESS libref is an alias for the DBMS database, schema, or server where
your tables and views are stored.
engine-name
is the SAS/ACCESS engine name for your DBMS, such as
oracle or
db2. The engine
name is required. Because the SAS/ACCESS LIBNAME statement associates a libref
with a SAS/ACCESS engine that supports connections to a particular DBMS, it
requires a DBMS-specific engine name.
See the documentation for your SAS/ACCESS interface for your engine’s name.
SAS/ACCESS-connection-options
provide connection information and control how SAS manages the timing and
concurrence of the connection to the DBMS; these arguments are different for each
database. For example, to connect to an Oracle database, your connection options are
USER=, PASSWORD=, and PATH=:
LIBNAME myoralib oracle user=testuser password=testpass path=’voyager’;
If the connection options contain characters that are not allowed in SAS names,
enclose the values of the arguments in quotation marks. On some DBMSs, if you
specify the appropriate system options or environment variables for your database,
you can omit the connection options.
See the documentation for your SAS/ACCESS interface for detailed information
about your connection options.
SAS/ACCESS-LIBNAME-options
define how DBMS objects are processed by SAS. Some LIBNAME options can
enhance performance; others determine locking or naming behavior. For example, the
PRESERVE_COL_NAMES= option enables you to specify whether to preserve spaces,
special characters, and mixed case in DBMS column names when creating tables.
The availability and default behavior of many of these options are DBMS-specific.
See the documentation for your SAS/ACCESS interface for a list of the LIBNAME
options that are available for your DBMS.
See “LIBNAME Options for Relational Databases” on page 68 for detailed
information about all of the LIBNAME options.
CLEAR
disassociates one or more currently assigned librefs.