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 UNIX and PC Hosts 4 Using DBSLICE= 465Using DBSLICE=You might achieve the best possible per<strong>for</strong>mance when using threaded reads byspecifying the DBSLICE= data set option <strong>for</strong> DB2 in your <strong>SAS</strong> operation. This isespecially true if your DB2 data is evenly distributed across multiple partitions in aDB2 Enterprise Extended <strong>Edition</strong> (EEE) database system. When you create a DB2table under the DB2 EEE model, you can specify the partitioning key you want to useby appending the clause PARTITIONING KEY(column-name) to your CREATE TABLEstatement. Here is how you can accomplish this by using the LIBNAME option,DBCREATE_TABLE_OPTS=, within the <strong>SAS</strong> environment./*points to a triple node server*/libname trlib2 db2 user=db2user pw=db2pwd db=sample3cDBCREATE_TABLE_OPTS=’PARTITIONING KEY(EMPNUM);proc delete data=trlib.MYEMPS1;run;data trlib.myemps(drop=morf whatstateDBTYPE=(HIREDATE="date" SALARY="numeric(8,2)"NUMCLASS="smallint" GENDER="char(1)" ISTENURE="numeric(1)" STATE="char(2)"EMPNUM="int NOT NULL Primary Key"));<strong>for</strong>mat HIREDATE mmddyy10.;do EMPNUM=1 to 100;morf=mod(EMPNUM,2)+1;if(morf eq 1) thenGENDER=’F’;elseGENDER=’M’;SALARY=(ranuni(0)*5000);HIREDATE=int(ranuni(13131)*3650);whatstate=int(EMPNUM/5);if(whatstate eq 1) thenSTATE=’FL’;if(whatstate eq 2) thenSTATE=’GA’;if(whatstate eq 3) thenSTATE=’SC’;if(whatstate eq 4) thenSTATE=’VA’;elsestate=’NC’;ISTENURE=mod(EMPNUM,2);NUMCLASS=int(EMPNUM/5)+2;output;end;run;After the table MYEMPS is created on this three-node database, one-third of therows reside on each of the three nodes.

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

Saved successfully!

Ooh no, something went wrong!