LIBNAME Statement: PC Files on Linux, UNIX, and 64-Bit Microsoft Windows |
Controls the format of the WHERE clause when you use the DBKEY=
data set option.
Valid in |
DATA and PROC steps
|
Default value |
LIBNAME setting
|
If there might be NULL values in the transaction table
or the master table for the columns that you specify in the DBKEY=
DBKEY option, then use DBNULLKEYS=YES. When you specify DBNULLKEYS=YES and a column
not defined as NOT NULL in the DBKEY= option, SAS generates a WHERE clause
that can find NULL values. If you specify DBKEY=COLUMN and COLUMN is not defined
as NOT NULL, SAS generates a WHERE clause with the following syntax.
WHERE ((COLUMN = ?) OR ((COLUMN IS NULL) AND (? IS NULL)));
SAS prepares the statement once, and uses it for any value (NULL or
NOT NULL) in the column.
Note: This syntax has the potential to be much
less efficient than the shorter form of the WHERE clause. ![[cautionend]](../../../../common/63294/HTML/default/images/cautend.gif)
When
you specify DBNULLKEYS=NO or specify a column that is defined as NOT NULL
in the DBKEY= option, SAS generates a simple WHERE clause.
If you know that there are no NULL values in the columns specified in
the DBKEY= option, use DBNULLKEYS=NO. If you specify DBNULLKEYS=NO and specify
DBKEY=COLUMN, SAS generates a shorter form of the WHERE clause.
WHERE (COLUMN = ?)
To assign this option to a group of tables, use the DBNULLKEYS= option
specified in LIBNAME Options.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.