SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 46674: How to have SAS® Enterprise Guide® prompt you for a database user ID and password

DetailsAboutRate It

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

  1. 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.
  2. In the panel on the right, right-click Connection: oracle_prompt and select Properties. The Connection: oracle_prompt Properties dialog box appears: image label

  3. In the dialog box, click the Options tab.
  4. From the Authentication type drop-down menu, select Prompt.
  5. Click New. The New Authentication Domain dialog box appears.
  6. 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.
  7. Back in the Connection: oracle_prompt Properties dialog box, click OK.

  8. image label

  9. Now, in the Data Library Manager plug-in, right-click the oracle_prompt library and select Properties. The oracle_prompt Properties dialog box appears.
  10. In the dialog box, click the Extended Attributes tab. And then click New:


    image label

  11. Under Field Name, enter Assignmode, and under Value, enter 0.
  12. Click New.
  13. For the second Field Name, enter loginmode and enter prompt for the value.
  14. 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

  1. In SAS Enterprise Guide, select View ► Prompt Manager.
  2. In the Prompt Manager pane, click Add. The Add New Prompt dialog box appears.
  3. 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.
  4. Example: My_PASSWORD

  5. Click the Prompt Type and Values tab.
  6. From the Prompt type drop-down menu, select Text.
  7. From the Method for populating prompt drop-down menu, select User enters values.
  8. From the Text type drop-down menu, select Masked single line (for password entry).

  9. image label

  10. From the Method for encoding masked text drop-down menu, select (none).
  11. Click OK to save your entries and close the window.
  12. Right-click your program task and select Properties. The Properties for task_name dialog box appears.
  13. In the dialog box, click Prompts and then Add. The Select Prompts dialog box appears. It should contain your new named prompt.

  14. image label

  15. In the dialog box, click the name of your prompt and click OK.
  16. In the Properties for task_name dialog box, click OK. The prompt is now associated with your code node.
  17. 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;

  18. image label

When the code runs, you are prompted to enter the password as shown above.



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS Enterprise GuideMicrosoft® Windows® for x644.29.2 TS2M3
Microsoft Windows Server 2003 Datacenter Edition4.29.2 TS2M3
Microsoft Windows Server 2003 Enterprise Edition4.29.2 TS2M3
Microsoft Windows Server 2003 Standard Edition4.29.2 TS2M3
Microsoft Windows Server 2003 for x644.29.2 TS2M3
Microsoft Windows Server 20084.29.2 TS2M3
Microsoft Windows Server 2008 for x644.29.2 TS2M3
Microsoft Windows XP Professional4.29.2 TS2M3
Windows 7 Enterprise 32 bit4.29.2 TS2M3
Windows 7 Enterprise x644.29.2 TS2M3
Windows 7 Home Premium 32 bit4.29.2 TS2M3
Windows 7 Home Premium x644.29.2 TS2M3
Windows 7 Professional 32 bit4.29.2 TS2M3
Windows 7 Professional x644.29.2 TS2M3
Windows 7 Ultimate 32 bit4.29.2 TS2M3
Windows 7 Ultimate x644.29.2 TS2M3
Windows Vista4.29.2 TS2M3
Windows Vista for x644.29.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.