A SERVICE OF

logo

241
CHAPTER
13
Accessing DBMS Data with the
LIBNAME Statement
About the LIBNAME Statement Sample Code
241
Creating SAS Data Sets from DBMS Data
242
Using the PRINT Procedure with DBMS Data
242
Combining DBMS Data and SAS Data
243
Reading Data from Multiple DBMS Tables
244
Using the DATA Step’s UPDATE Statment with DBMS Data 245
Using the SQL Procedure with DBMS Data
246
Querying a DBMS Table
246
Querying Multiple DBMS Tables
249
Updating DBMS Data
251
Creating a DBMS Table
253
Using Other SAS Procedures with DBMS Data
254
Using the MEANS Procedure 254
Using the DATASETS Procedure 255
Using the CONTENTS Procedure 256
Using the RANK Procedure 257
Using the TABULATE Procedure 258
Using the APPEND Procedure 259
Calculating Statistics from DBMS Data 259
Selecting and Combining DBMS Data 260
Joining DBMS and SAS Data 261
About the LIBNAME Statement Sample Code
This section contains examples that use the LIBNAME statement to associate librefs
with DBMS objects, such as tables and views. The LIBNAME statement is the
recommended method for accessing DBMS data from within SAS.
These examples work with all of the SAS/ACCESS relational interfaces except for the
interface to Oracle Rdb, which does not support the LIBNAME statement. To run these
examples, complete the following steps:
1 Modify and submit the appropriate autoexec program for your DBMS interface:
DB2
db2auto.sas
Informix
infauto.sas
ODBC and Microsoft SQL Server
odbauto.sas
OLE DB