![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS/ACCESS Software for Relational Databases: Reference |
| Arguments to Connect to DB2 |
|
CONNECT TO DB2<AS
alias><(SSID=DB2-subsystem-id>
<SERVER=DRDA-database-system)>; |
Refer to Setting Your DB2 Subsystem Identifier for information on setting your subsystem ID or contact your DBA.
proc sql;
connect to db2 (ssid=db2);
execute (create view testid.whotookorders as
select ordernum, takenby, firstname,
lastname, phone
from testid.orders, testid.employees
where testid.orders.takenby=
testid.employees.empid)
by db2;
execute (grant select on testid.whotookorders
to testuser) by db2;
disconnect from db2;
quit;
proc sql;
select *
from connection to db2
(select
* from testid.customers
where
customer like '1%');
disconnect from db2;
quit;
The next example creates the PROC SQL view VLIB.STOCKORD that
is based on the table TESTID.ORDERS. The table TESTID.ORDERS is an SQL/DS
table that is accessed through DRDA.
libname vlib 'SAS-data-library'
proc sql;
connect to db2 (server=testserver);
create view vlib.stockord as
select * from connection to
db2(select ordernum, stocknum,
shipto, dateorderd
from testid.orders);
disconnect from db2;
quit;
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.