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.

518 Examples 4 Chapter 16data shlib.table1(bulkload=yes bl_db2tblxst=yes bl_db2ldct1=’RESUME YES’);set shlib.table1;run;Replace Table1 with itself.data shlib.table1(bulkload=yes bl_db2tblxst=yes bd_db2ldct1=’REPLACE’);set shlib.table1;run;Load DB2 tables directly from other objects.data db2lib.emp (bulkload=yes);bl_db2ldct1=’replace log no nocopypend’ bl_db2cursor=’select * from dsn8710.emp’);set db2lib.emp (obs=0);run;You can also use this option in a PROC SQL statement to load DB2 tables directlyfrom other objects, as shown below.options sastrace=’,,,d’;libname db2lib db2 authid=dsn8710;libname mylib db2;proc delete data mylib.emp;run;proc sql;connect to db2;create table mylib.emp(BULKLOAD=YESBL_DB2LDCT1=’REPLACE LOG NO NOCOPYPEND’BL_DB2CURSOR=’SELECT FIRSTNAME, LASTNAME, WORKDEPT,HIREDATE, JOB, SALARY, BONUS, COMMFROM DSN8710.EMP’)as select firstname, lastname, workdept,hiredate, job, salary, bonus, commfrom db2lib.emp (obs=0);quit;Here is another similar example.options sastrace=’,,,d’;libname db2lib db2 authid=dsn8710;libname mylib db2;proc delete data mylib.emp;run;proc sql;connect to db2;create table mylib.emp(BULKLOAD=YESBL_DB2LDCT1=’REPLACE LOG NO NOCOPYPEND’BL_DB2CURSOR=’SELECT FIRSTNAME, LASTNAME, WORKDEPT,HIREDATE, JOB, SALARY, BONUS, COMM

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

Saved successfully!

Ooh no, something went wrong!