Hi,
I would like to use saspy to connect to SAS via Python. I have SAS EG 7.1 installed on my computer.
The main problem I have right now is that the jar files required for connecting are nowhere to be found on my computer, I don't have a SASDeploymentManager folder in my SASHome directory.
Anyone else using SAS EG with saspy ?
Thank you !
For the record, I have searched everywhere and the error I get seems to be caused by the missing jar files as described in the Troubleshooting section of the saspy guide.
java.lang.NoClassDefFoundError: com/sas/services/connection/ConnectionFactoryException
Hi,
All right, the problem was solved by IT, they sent me the jar files, I've put them in a local folder and it worked. Then I ran into other issues related to connection to a metaserver which I solved by using the information provided here and here (FriedEgg Feb 28 response). Also, I don't know why but the saspy.cfg doesn't seem to properly loaded sometimes, anyhow, I ended up hardcoding the jar path and also the port as suggested here and now everything works. Be sure to use Java 7 as mentioned in the docs, otherwise it won't work.
If you want to access SAS on a remote server using Python, you should talk to the admins of that server.
If you want to access SAS on a remote server using Python, you should talk to the admins of that server
Already done, I have access to the servers through SAS, I have the connection parameters. This has nothing to do with my access, I just don't have the required files on disk and I'm the first to request access with Python, so I have to figure out and they also have to figure out how to get me access.
Hey, so I think you can get what you need. The jars will be in the SAS installation where the workspace server you are connecting to is running (the one EG connects to currently). You said you have a SAS admin, or talked to them? If you can't access that system where the jars are yourself, they should be able to get there. You can copy those jars from that system to your client machine and put them in whatever directory you want. Then just point your classpath to where you put them. Those jars or compatible between windows and linux, so you don't have to worry about that either. If you know of a SAS 9.4 install on another machine that you can access, you can grab them from there too.
Tom
Hi,
All right, the problem was solved by IT, they sent me the jar files, I've put them in a local folder and it worked. Then I ran into other issues related to connection to a metaserver which I solved by using the information provided here and here (FriedEgg Feb 28 response). Also, I don't know why but the saspy.cfg doesn't seem to properly loaded sometimes, anyhow, I ended up hardcoding the jar path and also the port as suggested here and now everything works. Be sure to use Java 7 as mentioned in the docs, otherwise it won't work.
I'm glad that you're up and running! I see from the links, the issue was the host and port, which are for the Object spawner and Workspace server, not the metadata server. You solved that and are connecting. Not sure about the config file though, so if you'd like to explore that further, just let me know. I'm sure we can figure out what's going on with that.
We can continue here, or you can open an issue on saspy (https://github.com/sassoftware/saspy/issues), either way is fine. I can help either way!
Thanks!
Tom
Well, the second issue was that I was connecting to the metadata server and I was getting this error message: “The client has connected to a SAS Metadata Server (v1.0) when it intended to connect to a SAS Workspace Server.”
This is due to the fact that in SAS Enterprise Guide, the server information you see in your connection profile are those of the Metadata Server (I believe). So then I ran the proc in the links to find the address of the Workspace Server and used the default 8591 port to connect to it, and voilà.
Thank you
Yes, that makes perfect sense.
As I'm regrettably new to SAS Communities, I'm not sure how a particular post gets marked as the 'answer'.
Do you believe that your previous post, stating that you've go it working should be marked as that? I don't see how to mark it as such, myself. Maybe only the person who creates the thread can mark it that way?
Also, can I help with the config file? Is that still a problem?
Thanks,
Tom
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.