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.

<strong>SAS</strong>/<strong>ACCESS</strong> Interface to DB2 Under z/OS 4 Modifying DB2 Data 505SQL StatementSQL SQL-statement;The SQL statement specifies an SQL statement that you want the procedure toexecute dynamically. The procedure rejects SQL SELECT statements.UPDATE StatementUPDATE;The UPDATE statement causes the table to be updated by using the mappingspecifications that you supply. If you do not specify an input or an output mapping dataset or an SQL output file, the table is updated by default.If you have specified an output mapping data set in the SQLOUT= option, PROCDB2UTIL creates the mapping data set and ends the procedure. However, if you specifyUPDATE, the procedure creates the mapping data set and updates the DB2 table.WHERE StatementWHERE SQL-WHERE-clause;The WHERE statement specifies the SQL WHERE clause that you want to use toupdate the DB2 table. This statement is combined with the SQL statement generatedfrom your mapping specifications. Any <strong>SAS</strong> variable names in the WHERE clause aresubstituted at that time, as shown in this example.where db2col = %sasvar;ERRLIMIT StatementERRLIMIT=error-limit;The ERRLIMIT statement specifies the number of DB2 errors that are permittedbe<strong>for</strong>e the procedure terminates.EXIT StatementEXIT;The EXIT statement exits from the procedure without further processing. No outputdata is written, and no SQL statements are issued.Modifying DB2 DataThe DB2UTIL procedure generates SQL statements by using data from an input <strong>SAS</strong>data set. However, the <strong>SAS</strong> data set plays a different role <strong>for</strong> each type of modificationthat is available through PROC DB2UTIL. These sections show how you use each typeand how each type uses the <strong>SAS</strong> data set to make a change in the DB2 table.Inserting DataYou can insert observations from a <strong>SAS</strong> data set into a DB2 table as rows in thetable. To use this insert function, name the <strong>SAS</strong> data set that contains the data youwant to insert and the DB2 table to which you want to add in<strong>for</strong>mation in the PROCDB2UTIL statement. You can then use the MAPTO statement to map values from <strong>SAS</strong>variables to columns in the DB2 table. If you do not want to insert the values <strong>for</strong> allvariables in the <strong>SAS</strong> data set into the DB2 table, map only the variables that you wantto insert. However, you must map all DB2 columns to a <strong>SAS</strong> column.

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

Saved successfully!

Ooh no, something went wrong!