Accessing Other Vendors' DBMS Data |
Using DBMS Data in SAS
Programs |
After you associate a libref with a DBMS, you can reference database
objects, such as tables and views, by using the syntax
libref.object-name This is the same as the familiar syntax for two-level SAS names: libref.filename For example, the SAS/ACCESS LIBNAME statement below associates the libref Oraclib with an ORACLE database. Then the PROC SQL step references the ORACLE table STAFF as Oraclib.Staff. libname oraclib oracle user=kilroy password=washere path=oracpath preserve_col_names=yes; proc sql; create table oraclib.emps as (select IDnum, LName, FName from oraclib.staff where City="STAMFORD"); quit;
Because DBMS objects are treated as SAS data sets, your SAS programs can process DBMS data with SAS DATA steps and procedures. The result is transparent data integration, as shown in the examples on the following pages.
|
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.