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
Did you fix your config file? Are you connected now?
This resource may be helpful:
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
Did you fix your config file? Are you connected now?
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!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.