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.

502 Examples 4 Chapter 16EXIT StatementEXIT;The EXIT statement terminates the procedure without further processing.ExamplesThis code creates a <strong>SAS</strong> data set named MyLib.NoFmt that includes three columnsfrom the DB2 table EmplInfo. The RENAME statement changes the name of the thirdcolumn that is listed in the SELECT statement (from firstname in the DB2 table tofname in the <strong>SAS</strong> data set./* specify the <strong>SAS</strong> library where the <strong>SAS</strong> data set is to be saved */libname mylib ’userid.xxx’;proc db2ext ssid=db25 out=mylib.nofmt;select employee, lastname, firstname from sasdemo.emplinfo;rename 3=fname;run;This code uses a mapping file to specify which data to include in the <strong>SAS</strong> data setand how to <strong>for</strong>mat that data./* specify the <strong>SAS</strong> library where the <strong>SAS</strong> data set is to be saved */libname mylib ’userid.xxx’;/* specify the <strong>SAS</strong> library that contains the mapping data set */libname inlib ’userid.maps’;proc db2ext in=inlib.mapping out=mylib.mapout ssid=db25;run;The DB2UTIL ProcedureOverviewYou can use the DB2UTIL procedure to insert, update, or delete rows in a DB2 tableusing data from a <strong>SAS</strong> data set. You can choose one of two methods of processing:creating an SQL output file or executing directly. PROC DB2UTIL runs interactively,noninteractively, or in batch mode.Support <strong>for</strong> the DB2UTIL procedure provides compatibility with <strong>SAS</strong> 5 version of<strong>SAS</strong>/<strong>ACCESS</strong> Interface to DB2 under z/OS. It is not added to other <strong>SAS</strong>/<strong>ACCESS</strong>DBMS interfaces, and enhancement of this procedure <strong>for</strong> future releases of<strong>SAS</strong>/<strong>ACCESS</strong> are not guaranteed. It is recommended that you write new applicationsby using LIBNAME features.The DB2UTIL procedure uses the data in an input <strong>SAS</strong> data set, along with yourmapping specifications, to generate SQL statements that modify the DB2 table. TheDB2UTIL procedure can per<strong>for</strong>m these functions.DELETE

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

Saved successfully!

Ooh no, something went wrong!