DEFER= LIBNAME Statement Option

Specifies when the connection to the DBMS occurs.

Valid in: SAS/ACCESS LIBNAME statement
CONNECT statement
Category: Data Access
Default: NO
Restriction: Do not set DEFER= to YES when you are using PROC DS2 to interact with your data. PROC DS2 assumes that a connection to your database is in place when the procedure is invoked.
Interactions: The default value of NO is overridden if DBPROMPT=YES.
The DEFER= option is ignored when CONNECTION=UNIQUE because a connection is performed every time a table is opened.
Microsoft SQL Server, Netezza, ODBC: When you specify DEFER=YES, you must also specify the PRESERVE_TAB_NAMES= and PRESERVE_COL_NAMES= options to the values that you want. Normally, SAS queries the data source to determine the correct defaults for these options during LIBNAME assignment, but specifying DEFER=YES postpones the connection. Because these values must be specified at the time of LIBNAME assignment, you must assign them explicitly when you specify DEFER=YES.
Data source: Amazon Redshift, Aster, DB2 under UNIX and PC Hosts, DB2 under z/OS, Google BigQuery, Greenplum, Hadoop, HAWQ, Impala, Informix, JDBC, Microsoft SQL Server, MySQL, Netezza, ODBC, OLE DB, Oracle, PostgreSQL, SAP HANA, SAP ASE, SAP IQ, Snowflake, Teradata, Vertica, Yellowbrick
Note: Support for Yellowbrick was added in SAS 9.4M7.
See: CONNECTION= LIBNAME option, DBPROMPT= LIBNAME option

Table of Contents

Syntax

DEFER=YES | NO

Syntax Description

YES

specifies that the connection to the DBMS occurs when a table in the DBMS is opened.

NO

specifies that the connection to the DBMS occurs when the libref is assigned by a LIBNAME statement.

Last updated: February 3, 2026