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 DBFORCE= Data Set Option 301Valid 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, Netezza, ODBC, OLE DB,Oracle, Sybase, Sybase IQ, TeradataSyntaxDBFORCE=YES | NOSyntax DescriptionYESspecifies that rows that contain data values that exceed the length of the DBMScolumn are inserted, and the data values are truncated to fit the DBMS columnlength.NOspecifies that the rows that contain data values that exceed the DBMS column lengthare not inserted.DetailsThis option determines how the <strong>SAS</strong>/<strong>ACCESS</strong> engine handles rows that contain datavalues that exceed the length of the DBMS column. DBFORCE= works only when youcreate a DBMS table with the DBTYPE= data set option—namely, you must specifyboth DBTYPE= and this option. DBFORCE= does not work <strong>for</strong> inserts or updates.There<strong>for</strong>e, to insert or update a DBMS table, you cannot use the DBFORCE=option—you must instead specify the options that are available with <strong>SAS</strong> procedures.For example, specify the FORCE= data set option in <strong>SAS</strong> with PROC APPEND.FORCE= overrides DBFORCE= when you use FORCE= with PROC APPEND or thePROC SQL UPDATE statement. PROC SQL UPDATE does not warn you be<strong>for</strong>e ittruncates data.ExampleIn this example, two librefs are associated with Oracle databases, and it does notspecify databases and schemas because it uses the defaults. In the DATA step,MYDBLIB.DEPT is created from the Oracle data that MYORALIB.STAFF references.The LASTNAME variable is a character variable of length 20 in MYORALIB.STAFF.When MYDBLIB.DEPT is created, the LASTNAME variable is stored as a column oftype character and length 10 by using DBFORCE=YES.libname myoralib oracle user=tester1 password=tst1;libname mydblib oracle user=lee password=dataman;data mydblib.dept(dbtype=(lastname=’char(10)’)db<strong>for</strong>ce=yes);set myoralib.staff;run;

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

Saved successfully!

Ooh no, something went wrong!