Closed jdsmith65 closed 5 months ago
Hey, I'm OOO till Jan 29th. I will reply to this then! Sorry for the delay. Thanks, Tom
Hey @jdsmith65, sorry for the OOO reply, I was trying to get that set up yester as I will be out after today. Looking at the error, it's likely to simply be that you're using the wrong set of servers for your account/region. Somewhat recently, ODA added a second set of server in the US region. The first thing to try would be to add those to your iomhost list, or replace it with those, as there's no point trying 4 servers that we know aren't right, if the others turn out to be the right ones. Here's the doc: https://support.sas.com/ondemand/saspy.html And here's the relevant couple lines:
'iomhost' : ['odaws01-usw2.oda.sas.com','odaws02-usw2.oda.sas.com','odaws03-usw2.oda.sas.com','odaws04-usw2.oda.sas.com'],
Can you swap out your iomhost list with ['odaws01-usw2-2.oda.sas.com','odaws02-usw2-2.oda.sas.com'], and see if you can connect?
Thanks, Tom
Connection established!
Thanks for your help. Easy fix.
Best, Jared
Sweet!, That's how I like 'em, lol :) Glad that was all it was.
Hi, there,
I am trying to use SASpy, but am getting a connection error.
The setup
Here is my code that installs the package and sets it up: import os import subprocess
def install_saspy(env_name):
Install saspy in the specified environment
def create_sascfg_personal():
Define the directory to the sascfg_personal.py in the user's home directory within .config/saspy/
SAS_config_names=['oda'] oda = {'java' : '/Library/Java/JavaVirtualMachines/openjdk.jdk/Contents/Home/bin/java', 'iomhost' : ['odaws01-usw2.oda.sas.com','odaws02-usw2.oda.sas.com','odaws03-usw2.oda.sas.com','odaws04-usw2.oda.sas.com'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' } """
def create_authinfo(): authinfo_content = "oda user RealUserName password MyRealPassword"
Set path directly under the user's home directory.
def setup_saspy(env_name): install_saspy(env_name) create_sascfg_personal() create_authinfo()
I can successfully use setup_saspy and then import saspy. I saw in another closed issue that there are SAS jar files to be used, so I've pasted them into (what I think is) the correct folder: "/Users/jaredsmith/anaconda3/envs/foodfinance/lib/python3.11/site-packages/saspy/java/iomclient"
The Error
However, when I attempt to connect I get this error: sas_session = saspy.SASsession() Using SAS Config named: oda We failed in getConnection The application could not log on to the server "odaws04-usw2.oda.sas.com:8591". No server is available at that port on that machine.
SAS process has terminated unexpectedly. Pid State= (72687, 64000) Traceback (most recent call last):
Cell In[2], line 1 sas_session = saspy.SASsession()
File ~/anaconda3/envs/foodfinance/lib/python3.11/site-packages/saspy/sasbase.py:562 in init self._io = SASsessionIOM(sascfgname=self.sascfg.name, sb=self, **kwargs)
File ~/anaconda3/envs/foodfinance/lib/python3.11/site-packages/saspy/sasioiom.py:300 in init self._startsas()
File ~/anaconda3/envs/foodfinance/lib/python3.11/site-packages/saspy/sasioiom.py:556 in _startsas ll = self.submit("options svgtitle='svgtitle'; options validvarname=any validmemname=extend pagesize=max nosyntaxcheck; ods graphics on;", "text")
File ~/anaconda3/envs/foodfinance/lib/python3.11/site-packages/saspy/sasioiom.py:963 in submit raise SASIOConnectionTerminated(Exception)
SASIOConnectionTerminated: <class 'Exception'>
Additional Details
I am using Python 3.11.6 inside a Conda environment and saspy version 5.5.0. I work for a university and have tried to connect at home with and without a VPN and while on campus.
Please let me know what I am doing wrong.
Thanks!