Usage Note 46674: How to have SAS® Enterprise Guide® prompt you for a database user ID and password
This SAS Note describes how to have SAS Enterprise Guide prompt you for a user ID and password when you access a database library. To set up this prompt, perform one of the following procedures. Use the first procedure if your library was defined in SAS® Management Console. Use the latter procedure if your library was defined using a LIBNAME statement in the SAS code.
When Your Library Is Defined in SAS Management Console
From the Server Manager plug-in, highlight the name of the database server that you created. For this example, we use the name oracle_prompt.
In the panel on the right, right-click Connection: oracle_prompt and select Properties. The Connection: oracle_prompt Properties dialog box appears:
In the dialog box, click the Options tab.
From the Authentication type drop-down menu, select Prompt.
Click New. The New Authentication Domain dialog box appears.
In the New Authentication Domain dialog box, enter a name of your choosing (for example, foo). You can also enter a description, but this is optional. Click OK.
Back in the Connection: oracle_prompt Properties dialog box, click OK.
Now, in the Data Library Manager plug-in, right-click the oracle_prompt library and select Properties. The oracle_prompt Properties dialog box appears.
In the dialog box, click the Extended Attributes tab. And then click New:
Under Field Name, enter Assignmode, and under Value, enter 0.
For the second Field Name, enter loginmode and enter prompt for the value.
Restart SAS Enterprise Guide and then try assigning the library. You should be prompted for your database user ID and password.
Note: This library behaves as a pre-assigned library, so all of the tables in that library are visible.
When Using a LIBNAME Statement in Your SAS Code or Program
In SAS Enterprise Guide, select View ► Prompt Manager.
In the Prompt Manager pane, click Add. The Add New Prompt dialog box appears.
In the dialog box, click the General tab. In the Name field, enter a name for the new prompt, using this format: name_PASSWORD. Note that the text _PASSWORD is required to mask the entry.
Click the Prompt Type and Values tab.
From the Prompt type drop-down menu, select Text.
From the Method for populating prompt drop-down menu, select User enters values.
From the Text type drop-down menu, select Masked single line (for password entry).
From the Method for encoding masked text drop-down menu, select (none).
Click OK to save your entries and close the window.
Right-click your program task and select Properties. The Properties for task_name dialog box appears.
In the dialog box, click Prompts and then Add. The Select Prompts dialog box appears. It should contain your new named prompt.
In the dialog box, click the name of your prompt and click OK.
In the Properties for task_name dialog box, click OK. The prompt is now associated with your code node.
You should now be able to refer to the prompt macro in your code by using this syntax: