The SAS/ACCESS LIBNAME statement extends the SAS global LIBNAME statement so that you can assign a libref to a relational DBMS. This feature lets you reference a DBMS object directly in a DATA step or SAS procedure. You can use it to read from and write to a DBMS object as if it were a SAS data set. You can associate a SAS libref with a relational DBMS database, schema, server, or group of tables and views.
For details about the syntax, see LIBNAME Statement: External Databases. For the engine name, connection options, and LIBNAME options for your SAS/ACCESS interface, see the DBMS-specific reference section for your SAS/ACCESS interface.
For details about specifying and naming librefs, see Rules for Most SAS Names in SAS Programmer’s Guide: Essentials.
When you use the SAS/ACCESS LIBNAME statement to associate a libref with relational DBMS data, you might observe some behavior that differs from that of normal SAS librefs. Because these librefs refer to database objects, such as tables and views, they are stored in the format of your DBMS. DBMS format differs from the format of normal SAS data sets. This is helpful to remember when you access and work with DBMS data.
For example, you can sort the observations in a normal SAS data set and store the output in another data set. However, in a relational DBMS, sorting data often has no effect on how it is stored. Because you cannot depend on your data being sorted in the DBMS, you must sort the data at the time of query. Also, when you sort DBMS data, results might vary depending on whether your DBMS places data with NULL values (which SAS translates into missing values) at the beginning or the end of the result set.
When you use librefs that refer to DBMS data with SAS functions, some functions might return a value that differs from what is returned when you use the functions with normal SAS data sets. For example, the PATHNAME function might return a blank value. For a normal SAS libref, a blank value means that the libref is not valid. However, for a libref associated with a DBMS object, a blank value means only that there is no path name associated with the libref.
Usage of some functions might also vary. For example, the LIBNAME function can accept an optional SAS-library argument. When you use the LIBNAME function to assign or unassign a libref that refers to DBMS data, you omit this argument. For full details about how to use SAS functions, see the SAS Functions and CALL Routines: Reference.