13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

490 Examples 4 Chapter 16For in<strong>for</strong>mation about setting up DB2 z/OS so that <strong>SAS</strong> can connect to theDRDA server when the SERVER= option is used, see the installationinstructions <strong>for</strong> this interface.Although you can specify any LIBNAME option in the CONNECT statement,only SSID= and SERVER= are honored.ExamplesThis example connects to DB2 and sends it two EXECUTE statements to process.proc sql;connect to db2 (ssid=db2);execute (create view testid.whotookorders asselect ordernum, takenby, firstname,lastname, phonefrom testid.orders, testid.employeeswhere testid.orders.takenby=testid.employees.empid)by db2;execute (grant select on testid.whotookordersto testuser) by db2;disconnect from db2;quit;This next example omits the optional CONNECT statement, uses the default setting<strong>for</strong> DB2SSID=, and per<strong>for</strong>ms a query (shown in highlighting) on the Testid.Customerstable.proc sql;select * from connection to db2(select * from testid.customers where customer like ’1%’);disconnect from db2;quit;This example creates the Vlib.StockOrd SQL view that is based on the Testid.Orderstable. Testid.Orders is an SQL/DS table that is accessed through DRDA.libname vlib ’<strong>SAS</strong>-data-library’proc sql;connect to db2 (server=testserver);create view vlib.stockord asselect * from connection to db2(select ordernum, stocknum, shipto, dateorderdfrom testid.orders);disconnect from db2;quit;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!