Topics Map > SAS
Configuring Connections in SAS Enterprise Guide
Note about Badger Analytics Connections
Connections to Badger Analytics can only be created using a code-based connection and you must install the Snowflake ODBC Driver prior to connecting. Follow the instructions located here: https://docs.snowflake.com/en/user-guide/odbc.html
Wizard-Based Setup
-
Click the Servers module in the left pane and expand the Local server.
-
Right-click Libraries and click New library.
-
If you are not in a project, click Create Project.
-
Enter an 8-character or shorter name for the data source and click Next.
-
Under Engine type, select Database System.
-
Under Engine, select the appropriate database type connection and enter the specific details about that database. Click Next.
-
For Oracle connections using TNS, the database server is the TNS name of the database (e.g. DWHP, SFMRT, EPM).
-
For connections using the Windows ODBC Data Sources, leave Database Server blank.
-
-
Enter any additional configuration for the database connection (advanced, refer to SAS documentation). Click Next.
-
For connections using Windows ODBC Data Sources, set the following values:
-
Name: Data Source Name, Value: The data source name as it is listed in ODBC Data Sources
-
-
For connections using Snowflake / Badger Analytics, set the following values:
-
Additional Options: authenticator=externalbrowser
-
-
-
Review the details and click Test Library to test connecting to the database. If you see OK, click Finish. If not, click Show Log for error code details.
Code-based Configuration
A default SAS connections template with connections to EPM, InfoAccess, and Badger Analytics has been put together; you will need to provide your own credentials. Keep this file in an easy to access place (e.g., Documents folder, Box folder, etc.), as you will need to use it every time you run SAS Enterprise Guide. When you need to use the file, you can drag it into the process flow and SAS Enterprise Guide will automatically create a shortcut to the file.
While it is technically possible to enter passwords in plain text, do not enter passwords in plain text in the connection file. This is a very, very bad idea.
SAS provides a password encoding feature so you can enter an encoded password into the password field, so your credentials aren’t compromised if someone gets your connections file.
Encoding a Password
-
While in a process flow, right click in the work area and click Add new > Program.
-
Double click the new icon in the work area.
-
In the code pane, enter the following command, replacing "<your password>" with your database password between the quotes and click Run.
proc pwencode in='<your password>'; run;
-
In the log pane, you should find a line starting with {SAS002}. The entire line is the encoded password. Copy and paste this line to your connections file.
-
You can now delete the Program file by right clicking it in the work area and clicking Delete.
Loading a Code-based Connection Configuration File
You will need to include and run the connections file every time you open SAS Enterprise Guide and anytime you make changes to the connections file. While SAS Enterprise Guide is open, your connections should remain active until you close the program or the database times out the connection.
-
While in a process flow, you can either drag and drop the connections file into the work area or right click in the work area and click Add existing items.
-
You should see the connections file within the work area. Double click the file and click Run.