BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
agrisampath
Calcite | Level 5

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
sastpw
SAS Employee

Did you fix your config file? Are you connected now?

View solution in original post

3 REPLIES 3
sastpw
SAS Employee

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

sastpw
SAS Employee

Did you fix your config file? Are you connected now?

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 3 replies
  • 803 views
  • 1 like
  • 3 in conversation