DBFORCE= Data Set Option

Specifies whether to force the truncation of data during insert processing.

Valid in: DATA and PROC steps
Default: NO
Supports: All

Syntax

DBFORCE= YES | NO

Syntax Description

YES

specifies that the rows which contain data values that exceed the length of the DBMS column are inserted, and the data values are truncated to fit the DBMS column length.

NO

specifies that the rows which contain data values thatexceed the DBMS column length are not inserted.

Details

This option determines how the driver handles rows that contain data values that exceed the length of the DBMS column.
The SAS data set option FORCE= overrides this option when it is used with PROC APPEND or the PROC SQL UPDATE statement. The PROC SQL UPDATE statement does not provide a warning before truncating the data.

Example: Truncating Data during Insert Processing

In the following example, two librefs are associated with Oracle databases. The default databases and schemas are used and therefore are not specified. In the DATA step, MyDBLib.Dept is created from the Oracle data that is referenced by MyOraLib.Staff. The LastName column is a character column of length 20 in MyOraLib.Staff. During the creation of MyDBLib.Dept, the LastName column is stored as a column of type character and length 10 by using DBFORCE=YES.
libname myoralib fedsvr server="d1234.us.company.com" 
   port=2171 user=user1 pwd=pass1
   dsn=oradsn1 dsnuser=orauser dsnpwd=orapwd;
libname mydblib fedsvr server="d1234.us.company.com" 
   port=2171 user=user1 pwd=pass1
   dsn=oradsn2 dsnuser=orauser dsnpwd=orapwd;
data mydblib.dept (dbtype=(lastname='char(10)') dbforce=yes);
   set myoralib.staff;
run;