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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Data Set Options <strong>for</strong> <strong>Relational</strong> <strong>Databases</strong> 4 DBKEY= Data Set Option 305DBKEY= Data Set OptionSpecifies a key column to optimize DBMS retrieval.Default value:noneValid in: DATA and PROC steps (when accessing DBMS data using <strong>SAS</strong>/<strong>ACCESS</strong>software)DBMS support: Aster nCluster, DB2 under UNIX and PC Hosts, DB2 under z/OS,Greenplum, HP Neoview, In<strong>for</strong>mix, Microsoft SQL Server, MySQL, Netezza, ODBC,OLE DB, Oracle, Sybase, Sybase IQ, TeradataSyntaxDBKEY=(column-1)Syntax Descriptioncolumn<strong>SAS</strong> uses this to build an internal WHERE clause to search <strong>for</strong> matches in theDBMS table based on the key column. For example:select * from sas.a, dbms.b(dbkey=x) where a.x=b.x;In this example, DBKEY= specifies column x, which matches the key column thatthe WHERE clause designates. However, if the DBKEY= column does NOT matchthe key column in the WHERE clause, DBKEY= is not used.DetailsYou can use this option to potentially improve per<strong>for</strong>mance when you are processing ajoin that involves a large DBMS table and a small <strong>SAS</strong> data set or DBMS table.When you specify DBKEY=, it is strongly recommended that an index exists <strong>for</strong> thekey column in the underlying DBMS table. Per<strong>for</strong>mance can be severely degradedwithout an index.CAUTION:Improper use of this option can decrease per<strong>for</strong>mance. For detailed in<strong>for</strong>mationabout using this option, see the “Using the DBINDEX=, DBKEY=, andMULTI_DATASRC_OPT= Options” on page 48. 4ExamplesThis example uses DBKEY= with the MODIFY statement in a DATA step:libname invty db2;data invty.stock;set addinv;modify invty.stock(dbkey=partno) key=dbkey;INSTOCK=instock+nwstock;RECDATE=today();if _iorc_=0 then replace;

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

Saved successfully!

Ooh no, something went wrong!