Previous Page | Next Page

LIBNAME Statement: PC Files on Linux, UNIX, and 64-Bit Microsoft Windows

DBNULL



Indicates whether NULL is a valid value for the specified columns when a table is created.
Valid in: DATA and PROC steps
Default value: YES

Syntax
Syntax Description
Details
Examples

Syntax

DBNULL=
(<column-name-1>=YES|NO
<column-name-n>=YES|NO
<_ALL_>=YES|NO)

Syntax Description

YES

specifies that the NULL value is valid for the specified columns.

NO

specifies that the NULL value is not valid for the specified columns.


Details

This option is valid only for creating data source tables. If you specify more than one column name, the names must be separated with spaces.

The DBNULL= option processes values from left to right. If you specify a column name twice, or if you use the _ALL_ value, the last value overrides the first value specified for the column.

Note:   Only the Access engine--not the Excel engine--supports this option.  [cautionend]


Examples

By using the DBNULL= option, the EmpId and Jobcode columns in the new MyDBLib.MyDept2 table are prevented from accepting null values. If the Employees table contains null values in the EmpId or Jobcode columns, the DATA step fails.

DATA mydblib.mydept2 (DBNULL=(empid=no jobcode=no));
   SET mydblib.employees;
RUN; 

All columns in the new MyDBLib.MyDept3 table except for the Jobcode column are prevented from accepting null values. If the Employees table contains null values in any column other than the Jobcode column, the DATA step fails.

DATA mydblib.mydept3 (DBNULL=(_ALL_=no jobcode=YES));
   SET mydblib.employees;
RUN; 

Previous Page | Next Page | Top of Page