- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am facing trouble using SAS on demand for academics in Jupyter. It worked initially but with a new session i am getting below stated error. I reinstalled anaconda, but couldnt eastablish connection
Traceback (most recent call last): File "C:\Users\SAMPATH\anaconda3\envs\SAS\lib\site-packages\IPython\core\interactiveshell.py", line 3441, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "C:\Users\SAMPATH\AppData\Local\Temp/ipykernel_15784/1555024843.py", line 2, in <module> sas_session = saspy.SASsession() File "C:\Users\SAMPATH\anaconda3\envs\SAS\lib\site-packages\saspy\sasbase.py", line 494, in __init__ self.sascfg = SASconfig(**kwargs) File "C:\Users\SAMPATH\anaconda3\envs\SAS\lib\site-packages\saspy\sasbase.py", line 130, in __init__ SAScfg = self._find_config(cfg_override=kwargs.get('cfgfile')) File "C:\Users\SAMPATH\anaconda3\envs\SAS\lib\site-packages\saspy\sasbase.py", line 328, in _find_config import sascfg_personal as SAScfg File "C:\Users\SAMPATH\anaconda3\envs\SAS\lib\site-packages\saspy\sascfg_personal.py", line 7 Asia Pacific Home Region ^ SyntaxError: invalid syntax
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Did you fix your config file? Are you connected now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This resource may be helpful:
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Your config file has a syntax error in it.:
File "C:\Users\SAMPATH\anaconda3\envs\SAS\lib\site-packages\saspy\sascfg_personal.py", line 7 Asia Pacific Home Region ^ SyntaxError: invalid syntax
The instructions for configuring this are here: https://support.sas.com/ondemand/saspy.html
The actual saspy config doc would be here: https://sassoftware.github.io/saspy/configuration.html#iom-using-java (the Remote case).
Given the config file should be:
SAS_config_names=['oda']
oda = {'java' : 'C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath\\java.exe', #US Home Region 'iomhost' : ['odaws01-usw2.oda.sas.com','odaws02-usw2.oda.sas.com','odaws03-usw2.oda.sas.com','odaws04-usw2.oda.sas.com'], #European Home Region #'iomhost' : ['odaws01-euw1.oda.sas.com','odaws02-euw1.oda.sas.com'], #Asia Pacific Home Region #'iomhost' : ['odaws01-apse1.oda.sas.com','odaws02-apse1.oda.sas.com'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }
It looks like you removed the comment from the comment line for the AP set of hosts. That's the Python syntax error you're getting.
If you were trying to use the AP set of hosts, you should uncomment the 'iomhosts' line under that comment, and comment out the default 'iomhosts' up under the US Home region. So it would look like this:
SAS_config_names=['oda'] oda = {'java' : 'C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath\\java.exe', #US Home Region #'iomhost' : ['odaws01-usw2.oda.sas.com','odaws02-usw2.oda.sas.com','odaws03-usw2.oda.sas.com','odaws04-usw2.oda.sas.com'], #European Home Region #'iomhost' : ['odaws01-euw1.oda.sas.com','odaws02-euw1.oda.sas.com'], #Asia Pacific Home Region 'iomhost' : ['odaws01-apse1.oda.sas.com','odaws02-apse1.oda.sas.com'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Did you fix your config file? Are you connected now?