Due to corporate constraints, the only solution available is SAS JDBC type of connection, using IOM server subprotocol.
I have been trying to make this work with our IT and SAS support on and off for months now. I had them install the SAS JDBC drivers on my machine, and via trial and error arrived at the below piece of R code to establish the connection:
library(RJDBC)
library(rJava)
.jinit()
driver <- JDBC(driverClass = "com.sas.rio.MVADriver")
conn <- dbConnect(
driver,
"jdbc:sasiom://xxx.xxx.xxx:12345",
"user",
"pwd"
)
running the above code I am able to create the driver object running JDBC() function, however, dbConnect throws the below exception:
Error in dbConnect(driver, "jdbc:sasiom://xxx.xxx.xxx:12345", :
Unable to connect JDBC to jdbc:sasiom://xxx.xxx.xxx:12345
JDBC ERROR: com/sas/util/ChainedExceptionInterfaceInterestingly, using the dbConnect function with a modified connection string,
conn <- dbConnect(
driver,
"jdbc:sasiom://xxx.xxx.xxx:12345?user=user&password=pwd"
)
gives a different error:
Error in dbConnect(driver, "jdbc:sasiom://xxx") :
Unable to connect JDBC to jdbc:sasiom://xxx
JDBC ERROR: com/sas/util/RBBaseUnfortunately neither of the error messages don't give too much to work with.
We have tried experimenting with different Java versions, and I have tripple checked that all required JAR files are accessible via CLASSPATH.
I have extensively researched the internet and asked LLMs to no avail, and so now my last hope is the community hivemind power..
java version "1.8.0_60"
SAS version 9.4 Grid M8
JDBC drivers 9.4
UPDATE:
Managed to resolve the above JDBC Errors, however, now there is a new challenge which popped up:
Looks like we have (finally!) connected to the SAS server, but, there seems to be some confusion as to which type of server the JDBC driver expects:
"JDBC ERROR: Unable to establish connection. The client has connected to a SAS Metadata Server (v1.0) when it intended to connect to a SAS Workspace Server."
It feels like we are getting close to the finish line on this one - it looks as it pertains the actual SAS Server, rather than my local Java / R / JDBC setup. If anyone has any ideas what this error means and how to fix it, please let me know
Have a look into this guide for connection examples
SAS 9.4 Drivers for JDBC: Cookbook
Look on page 26 (32/58), at the bottom, there is JDBC URL connection example
Hope it helps
thanks Ahmed, I have verified the JDBC URL I am using against the connection example in the cookbook, and it appears to be in the correct format.
@andre_young wrote:
thanks Ahmed, I have verified the JDBC URL I am using against the connection example in the cookbook, and it appears to be in the correct format.
But are you still using the URL that points to the Metadata server instead of the server that can actually give you data?
If you can't get the SAS admin to tell you what you need you might ask one of the SAS users to use the code in the answer to this thread to extract the information on the application servers from the metadata server.
Just as an FYI, Enterprise Guide is a .NET software which does not use JDBC protocol.
EG uses connection profile, which stores information such as
- Connection name:
- Connection Description:
- Metadata Server name
- Port : 8591 (Default)
- UserName:
- UserPW:
Your username has to be registered in the SAS Metadata base in order to authenticate you first, before it can figure out your authorization settings.
So if you don't have to SAS Enterprise Guide, contact your "SAS experts"/SAS Admin and verify you are registered and authorized to access the SAS deployment
I personally try to verify connection using multiple software packages where possible.
I would recommend finding another JDBC supporting software be it free, such as DBeaver Community Edition, or commercial, whichever you can get access to, to try connecting to SAS via JDBC.
In the past, I have discovered different packages have different level of support to standard protocols such JDBC/ODBC. Even Driver providers, have different level of supporting/implementing Driver Specifications.
Just a thought
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.