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.
- Click New.
- For the second Field Name, enter loginmode and enter prompt for the value.
- Click OK.
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.
Example: My_PASSWORD
- 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:
libname mylib oracle user=xxxx password=&My_PASSWORD path=yyyy;
When the code runs, you are prompted to enter the password as shown above.
Operating System and Release Information
SAS System | SAS Enterprise Guide | Microsoft® Windows® for x64 | 4.2 | | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Datacenter Edition | 4.2 | | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Enterprise Edition | 4.2 | | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Standard Edition | 4.2 | | 9.2 TS2M3 | |
Microsoft Windows Server 2003 for x64 | 4.2 | | 9.2 TS2M3 | |
Microsoft Windows Server 2008 | 4.2 | | 9.2 TS2M3 | |
Microsoft Windows Server 2008 for x64 | 4.2 | | 9.2 TS2M3 | |
Microsoft Windows XP Professional | 4.2 | | 9.2 TS2M3 | |
Windows 7 Enterprise 32 bit | 4.2 | | 9.2 TS2M3 | |
Windows 7 Enterprise x64 | 4.2 | | 9.2 TS2M3 | |
Windows 7 Home Premium 32 bit | 4.2 | | 9.2 TS2M3 | |
Windows 7 Home Premium x64 | 4.2 | | 9.2 TS2M3 | |
Windows 7 Professional 32 bit | 4.2 | | 9.2 TS2M3 | |
Windows 7 Professional x64 | 4.2 | | 9.2 TS2M3 | |
Windows 7 Ultimate 32 bit | 4.2 | | 9.2 TS2M3 | |
Windows 7 Ultimate x64 | 4.2 | | 9.2 TS2M3 | |
Windows Vista | 4.2 | | 9.2 TS2M3 | |
Windows Vista for x64 | 4.2 | | 9.2 TS2M3 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Date Modified: | 2012-07-19 11:34:32 |
Date Created: | 2012-05-25 14:33:43 |