BookmarkSubscribeRSS Feed
patulin
Calcite | Level 5

I am trying to configure saspy to connect to SAS On Demand for Academics via Pycharm on Mac OS 12.3.1 (Monterey). I have set up sascfg_personal.py as directed here. See contents below.

 

SAS_config_names=['oda']
oda = {'java' : '/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home',
#US Home Region 1
'iomhost' : ['odaws01-usw2.oda.sas.com','odaws02-usw2.oda.sas.com','odaws03-usw2.oda.sas.com','odaws04-usw2.oda.sas.com'],
#US Home Region 2
#'iomhost' : ['odaws01-usw2-2.oda.sas.com','odaws02-usw2-2.oda.sas.com'],
#European Home Region 1
#'iomhost' : ['odaws01-euw1.oda.sas.com','odaws02-euw1.oda.sas.com'],
#Asia Pacific Home Region 1
#'iomhost' : ['odaws01-apse1.oda.sas.com','odaws02-apse1.oda.sas.com'],
#Asia Pacific Home Region 2
#'iomhost' : ['odaws01-apse1-2.oda.sas.com','odaws02-apse1-2.oda.sas.com'],
'iomport' : 8591,
'authkey' : 'oda',
'encoding' : 'utf-8'
}

When running:

from saspy import SASsession
sas = saspy.SASsession()

I get the following error (no java error) with direction to run a few very long commands for diagnostic purposes.

The OS Error was:
No such file or directory
SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file.

Long story short, when running the recommended commands in Terminal, all looks fine except:

-bash: odaws02-usw2.oda.sas.com: command not found
-bash: odaws03-usw2.oda.sas.com: command not found
-bash: odaws04-usw2.oda.sas.com: command not found

Apparently odaws01-usw2.oda.sas.com is found? I'm out of my depth in solving this issue and I'm grateful for any insight!

4 REPLIES 4
sastpw
SAS Employee

Hey, the error you got is about java not being found. https://sassoftware.github.io/saspy/troubleshooting.html#java-problems

You show 

'java' : '/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home',

for java, which isn't java, so that's for sure the first problem. Also, I would issue

`import saspy'

not 

`from saspy import SASsession'

Not sure where you saw that. Import the package.

And set the java config to an actual java.exe (java executable; can't tell if you are on windows or what). You provided an authkey config value; did you put your credentials in the authinfo file (that the next thing once you point to a real java). 

Then give it another try.

patulin
Calcite | Level 5

I'm on a Mac, which is usually the source of my problems, so I don't have java.exe. Any idea what I'm looking for?

sastpw
SAS Employee

So, it won't have the windows .exe extension as part if it's filename, but Mac's can still have java installed, it's just the executable you need the path of. it would just be named java, in some directory where it's installed. I don't do 'I' things (Mac's are included in that), so I don't know where it would be installed or how you navigate the file system on that. I googled how to find the path to java on a mac and got this hit: https://stackoverflow.com/questions/15826202/where-is-java-installed-on-mac-os-x along with plenty others. You ought to be able to find it on the filesystem if it's already installed, or just install it and then be able to see where it is.

Jared_Duke
Calcite | Level 5

the 'java' default key location for mac is '/usr/bin/java' so the line in your sascfg_personal.py config file should be

'java' : '/usr/bin/java',

 

If for some reason you don't have java install I would install it via homebrew.

sas-innovate-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1532 views
  • 0 likes
  • 3 in conversation