DBPROMPT= LIBNAME Option

Specifies whether SAS displays a window that prompts the user to enter DBMS connection information before connecting to the DBMS in interactive mode.
Valid in: SAS/ACCESS LIBNAME statement
Default: NO
Interaction: DEFER= LIBNAME option
Data source: Aster nCluster, DB2 under UNIX and PC Hosts, Greenplum, HP Neoview, Informix, Microsoft SQL Server, MySQL, Netezza, ODBC, Oracle, Sybase, Sybase IQ, Teradata
See: DBPROMPT= data set option, DEFER= LIBNAME option

Syntax

DBPROMPT=YES | NO

Syntax Description

YES
specifies that SAS displays a window that interactively prompts you for the DBMS connection options the first time the libref is used.
NO
specifies that SAS does not display the prompting window.

Details

If you specify DBPROMPT=YES, it is not necessary to provide connection options with the LIBNAME statement. If you use the LIBNAME statement to specify connection options and DBPROMPT=YES, connection option values display in the window—except the password value, which appears as a series of asterisks. You can override all of these values interactively.
The DBPROMPT= option interacts with the DEFER= LIBNAME option to determine when the prompt window appears. If DEFER=NO, the DBPROMPT window appears when the LIBNAME statement is executed. If DEFER=YES, the DBPROMPT window appears when you first open a table or view. The DEFER= option normally defaults to NO, but it defaults to YES if DBPROMPT=YES. You can override this default by explicitly setting DEFER=NO.
The DBPROMPT window usually opens only once for each time that the LIBNAME statement is specified. It might open multiple times if DEFER=YES and the connection fails when SAS tries to open a table. In such cases, the DBPROMPT window appears until a successful connection occurs or you click Cancel.
The maximum password length for most of the SAS/ACCESS LIBNAME interfaces is 32 characters.
Oracle: You can enter 30 characters for the USERNAME and PASSWORD and up to 70 characters for the PATH, depending on your platform.
Teradata: You can enter up to 30 characters for the USERNAME and PASSWORD.

Examples

Example 1: Preventing a Prompt Window from Opening

In this example, the DBPROMPT window does not open when the LIBNAME statement is submitted because DEFER=YES. The DBPROMPT window appears when the PRINT procedure is processed, a connection is made, and the table is opened.
libname mydblib oracle dbprompt=yes
   defer=yes;
proc print data=mydblib.staff;
run;

Example 2: Allow a Prompt Window to Open Only Once

In this example, the DBPROMPT window appears while the LIBNAME statement is processing. The DBPROMPT window does not open in subsequent statements because the DBPROMPT window appears only once per LIBNAME statement.
libname mydblib oracle dbprompt=yes
   defer=no;

Example 3: Allow Values to Appear in a Prompt Window

In this example, values provided in the LIBNAME statement are pulled into the DBPROMPT window. The values testuser and ABC_server appear in the DBPROMPT window, and the user can edit and confirm them. The password value appears in the DBPROMPT window as a series of asterisks, so the user can also edit it.
libname mydblib oracle
        user=testuser pw=testpass
        path='ABC_server' dbprompt=yes defer=no;