BookmarkSubscribeRSS Feed
SASUser_86
Calcite | Level 5

Hi, we're currently using an odbc.ini file to store connection / dsn information. 

 

[athena]
Description=Simba Athena ODBC Driver (64-bit) 
DSNDriver=driver
AwsRegion=us-east-1
S3OutputLocation=s3://bucket/
Schema=database
AuthenticationType=IAM Profile

AwsProfile=default

 

I've been testing / vetting out which parameters are required and what I can include in my SAS statement instead of storing it in the ini file. 


LIBNAME athena ODBC DATAsrc=athena schema="sas";
proc sql;
SELECT *
FROM athena.sas;

 

I see that I can use "schema" which will overwrite the schema set ini file. I'm curious if this can be done with region? I tried a few statements without any success:

LIBNAME athena ODBC DATAsrc=athena schema="sas" region="us-east-1";
I tried replacing region with awsregion and BL_REGION, neither of these worked. 
 
Feedback is much appreciated. Thank you.
1 REPLY 1
JBailey
Barite | Level 11

You have two options available:

  1. DSN-less ODBC connections - you can read about it here. This is the approach that I used in the post you referenced.
  2. The CONOPTS= option.

The trick is to look at the documentation for the ODBC driver and find the supported options. These options can be passed via either of these options. 

 

The following code uses a DSN-less connection to connect to Athena. The information contained in the COMPLETE= option overrides the odbc.ini information.

libname athena odbc
complete="DRIVER={Simba Athena ODBC Driver};
AwsRegion=us-east-1;
S3OutputLocation=s3://bogus-athena-results/;
AuthenticationType=IAM Profile;
AwsProfile=617292732428-jbsandbox;" schema=somedb;

 

 

Here is an example of conopts=. The example shows how to pass the ODBC driver options to the driver. Like the DNS-less connection, CONOPTS= overrides the information in the odbc.ini file.

 

libname athena odbc datasrc=athena conopts="AwsRegion=us-east-1" schema=sas;

Check the documentation for the ODBC driver; there may be a way to use environment variables for some of this stuff.

 

Best wishes,

Jeff

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 895 views
  • 0 likes
  • 2 in conversation