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

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
1 ACCEPTED SOLUTION

Accepted Solutions
BonjourHi
Fluorite | Level 6

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.

View solution in original post

8 REPLIES 8
andreas_lds
Jade | Level 19

If you want to access SAS on a remote server using Python, you should talk to the admins of that server.

BonjourHi
Fluorite | Level 6

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.

LinusH
Tourmaline | Level 20
Me just reading documentation: SASPy somehow converts Python to SAS code in Jupyter notebook. Don't think Enterprise Guide take any part if this.
Data never sleeps
sastpw
SAS Employee

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

BonjourHi
Fluorite | Level 6

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.

sastpw
SAS Employee

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

BonjourHi
Fluorite | Level 6

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

sastpw
SAS Employee

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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 8 replies
  • 7095 views
  • 1 like
  • 4 in conversation