![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/b/da/bda6fccb-b246-43e7-a520-a01ed647b8cf/bda6fccb-b246-43e7-a520-a01ed647b8cf-bgfc.png)
242 Creating SAS Data Sets from DBMS Data Chapter 13
oleauto.sas
Oracle
oraauto.sas
SYBASE
sybauto.sas
Teradata
terauto.sas
2
Submit the SampData.sas program to create the DBMS tables and SAS data sets
that the sample code uses.
3
Submit the SampRun.sas program to run the samples.
These programs are available in the SAS Sample Library. If you need assistance
locating the Sample Library, contact your SAS support consultant. See “Descriptions of
the Sample Data” on page 271 for information about the tables that are used in the
sample code.
Note: Before you rerun an example that updates DBMS data, resubmit the
SampData.sas program to re-create the DBMS tables.
Creating SAS Data Sets from DBMS Data
After you associate a SAS/ACCESS libref with your DBMS data, you can use the
libref just as you would use any SAS libref. The following examples illustrate basic uses
of the DATA step with librefs that reference DBMS data.
Using the PRINT Procedure with DBMS Data
In the following example, the interface to DB2 creates the libref MyDbLib and
associates the libref with tables and views that reside on DB2. The DATA= option
specifies a libref that references DB2 data. The PRINT procedure prints a New Jersey
staff phone list from the DB2 table Staff. Information for staff from states other than
New Jersey is not printed. The DB2 table Staff is not modified.
libname mydblib db2 ssid=db2;
proc print data=mydblib.staff
(keep=lname fname state hphone);
where state = ’NJ’;
title ’New Jersey Phone List’;
run;
Output for this example is shown here.