- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
After careful research & troubleshooting, I have followed all the steps required to establish a SASPY connection to ODA (Ondemand for Academics) and I am still having trouble connecting. I have already installed the SAS IOM encryption jars (https://support.sas.com/downloads/package.htm?pid=2494) so that would eliminate the encryption as an issue.
Below is the sascfg_personal.py
SAS_config_names=['oda'] oda = {'java' : 'C:\\Users\\rsheth\\Java\\jdk-23.0.1\\bin\\java.exe', #US Home Region 2 'iomhost' : ['odaws01-usw2-2.oda.sas.com','odaws02-usw2-2.oda.sas.com'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'windows-1252' }
And below are the python commands I used to start the SAS session to ODA:
import pandas as pd import saspy sas=saspy.SASsession()
Now, I get the following error message:
Using SAS Config named: oda We failed in getConnection SAS process has terminated unexpectedly. RC from wait was: 4294967290 --------------------------------------------------------------------------- SASIOConnectionTerminated Traceback (most recent call last) Cell In[1], line 3 1 import pandas as pd 2 import saspy ----> 3 sas=saspy.SASsession() File ~\AppData\Local\anaconda3\Lib\site-packages\saspy\sasbase.py:594, in SASsession.__init__(self, **kwargs) 592 raise SASIONotSupportedError(self.sascfg.mode, alts=['IOM']) 593 elif self.sascfg.mode == 'IOM': --> 594 self._io = SASsessionIOM(sascfgname=self.sascfg.name, sb=self, **kwargs) 595 elif self.sascfg.mode == 'COM': 596 self._io = SASSessionCOM(sascfgname=self.sascfg.name, sb=self, **kwargs) File ~\AppData\Local\anaconda3\Lib\site-packages\saspy\sasioiom.py:317, in SASsessionIOM.__init__(self, **kwargs) 314 self._tomods1 = b"_tomods1" 315 self.sascfg = SASconfigIOM(self, **kwargs) --> 317 self._startsas() 318 self._sb.reconuri = None File ~\AppData\Local\anaconda3\Lib\site-packages\saspy\sasioiom.py:582, in SASsessionIOM._startsas(self) 580 if enc == '': 581 self.sascfg.encoding = 'utf-8' --> 582 ll = self.submit("options svgtitle='svgtitle'; options validvarname=any validmemname=extend pagesize=max nosyntaxcheck; ods graphics on;", "text") 583 self.sascfg.encoding = enc 585 if self.pid is None: File ~\AppData\Local\anaconda3\Lib\site-packages\saspy\sasioiom.py:988, in SASsessionIOM.submit(self, code, results, prompt, **kwargs) 986 #return dict(LOG=log.decode(errors='replace'), LST='') 987 logger.fatal(log.decode(errors='replace')) --> 988 raise SASIOConnectionTerminated(Exception) 989 except subprocess.TimeoutExpired: 990 pass SASIOConnectionTerminated: No SAS process attached. SAS process has terminated unexpectedly. <class 'Exception'>
I would appreciate your assistance in troubleshooting and fixing the issue so that I can submit SAS code through python. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @kharvel
check this documentation link:
This how to link: https://support.sas.com/ondemand/saspy.html
Using a text editor, we recommend you create two files:
"sascfg_personal.py"
"_authinfo"
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello AhmedAl_Attar,
Thank you for responding. I already used the documentation you linked to set up the saspy configuration (including the sascfg_personal.py and _authinfo). All of that appears to be set-up correctly. The error does not appear to be related to the configuration set-up. Do you have any insights into what the error messages are indicating?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Why does the error message say utf-8 but the config file does not?
Are you sure that you machine allows you to connect to that port on the ODA server? Perhaps your company firewall or your PC config is blocking that port?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The firewall thought is a good one. What's strange is that for various failures I can cause, they all provide some error message between what you had:
We failed in getConnection SAS process has terminated unexpectedly. RC from wait was: 4294967290
for instance, providing the wrong machine name:
>>> sas = saspy.SASsession(cfgname='oda', iomhost='bob')
We failed in getConnection
The application could not log on to the server "bob:8591". The machine name is not valid.
SAS process has terminated unexpectedly. RC from wait was: 4294967290
Since there is no actual error message coming back, it's likely you aren't getting to the ODA system. Since you're failing where you are, it seems Java is valid and found and starting up. So, I think looking into something like 'you can't get there from here' is the next step. Can you connect to ODA using other means like studio or EG from the same client machine?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I do not have SAS Studio or SAS EG installed. In fact, I don't have anything SAS installed on my machine. The only thing installed is python, Anaconda, and saspy
I am indeed behind a corporate firewall. Would a restrictive firewall cause this issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, a firewall can cause that problem. Do you have a computer at home, or not behind the corporate firewall to just try? Or do you have IT that can help with that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It would be worthwhile trying SODA via SAS Studio in your environment. This runs in a web browser so there is no installation required. If you have a firewall issue then SAS Studio will also fail but it might be easier to troubleshoot. If it does work, then you don't have a firewall issue and the problem is with the SASpy configuration.