sassoftware / saspy

A Python interface module to the SAS System. It works with Linux, Windows, and Mainframe SAS as well as with SAS in Viya.
https://sassoftware.github.io/saspy
Other
373 stars 150 forks source link

OMR user id #475

Closed Dopidotcsv closed 2 years ago

Dopidotcsv commented 2 years ago

Firs of all, I'd to apologize if this is not a bug; I just found this package and I am trying to start using it. When I do sas = saspy.SASsession(cfgname='XXX') on python, i get the following: Please enter the OMR user id: And my id company gets the following: The OS Error was: El sistema no puede encontrar el archivo especificado SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file. Attempted to run program /opt/anaconda3/envs/bi_development/bin/java with the following parameters:['/opt/anaconda3/envs/bi_development/bin/java', '-classpath', 'C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\saspyiom.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\log4j-1.2-api-2.12.4.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\log4j-api-2.12.4.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\log4j-core-2.12.4.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\sas.security.sspi.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\sas.core.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\sas.svc.connection.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.nls.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\sastpj.rutil.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\thirdparty\pfl-basic.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\thirdparty\pfl-tf.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '53843', '-stdoutport', '53844', '-stderrport', '53845', '-iomhost', 'lnxsasdtcn', '-iomport', '8593', '-user', 'e107338', '-lrecl', '1048576', ''] If no OS Error above, try running the following command (where saspy is running) manually to see what is wrong: /opt/anaconda3/envs/bi_development/bin/java -classpath "C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\saspyiom.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\log4j-1.2-api-2.12.4.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\log4j-api-2.12.4.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\log4j-core-2.12.4.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\sas.security.sspi.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\sas.core.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\sas.svc.connection.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.nls.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\iomclient\sastpj.rutil.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\thirdparty\pfl-basic.jar;C:\Users\e107338\PycharmProjects\churn\venv\lib\site-packages\saspy\java\thirdparty\pfl-tf.jar" pyiom.saspy2j -host localhost -stdinport 53843 -stdoutport 53844 -stderrport 53845 -iomhost lnxsasdtcn -iomport 8593 -user e107338 -lrecl 1048576

No SAS process attached. SAS process has terminated unexpectedly. Invalid response from SAS on inital submission. printing the SASLOG as diagnostic


SASIOConnectionError Traceback (most recent call last) Input In [2], in <cell line: 1>() ----> 1 sas = saspy.SASsession(cfgname='default')

File ~\PycharmProjects\churn\venv\lib\site-packages\saspy\sasbase.py:599, in SASsession.init(self, **kwargs) 596 pass 598 if failed: --> 599 raise SASIOConnectionError(res) 601 if self.pyenc is not None: 602 if self._io.sascfg.encoding != '':

SASIOConnectionError: Failure establishing SASsession. No SAS process attached. SAS process has terminated unexpectedly.

I'm trying to connect SAS from my company, but I don't have SAS installed. Thanks you

tomweber-sas commented 2 years ago

Hey, the error, though I'm not fluent in Spanish, is: The OS Error was: El sistema no puede encontrar el archivo especificado

which I believe is that the file you're trying to execute doesn't exist, which is: /opt/anaconda3/envs/bi_development/bin/java

So, this is the error described here: https://sassoftware.github.io/saspy/troubleshooting.html#java-problems You just need the correct path to a valid Java executable.

I see that you are trying to connect to a local install of SAS on your pc? But you mention you don't have it installed and are trying to connect to SAS at your company? That would be the Remote version of IOM rather than the Local. See the instructions here: https://sassoftware.github.io/saspy/configuration.html#iom-using-java

Can you currently connect to SAS at your company with any other client? Like EG or something? If so, then you should be able to connect with SASPy too.

tomweber-sas commented 2 years ago

Oh, nevermind about the Local/Remote; you do have the config for remote; I read that wrong. I see you have provided iomhost and iomport, though I can't tell if they are correct. The error about java not being found precludes trying to connect using that host and port. So, once you point to a good java executable, we'll see if the host and port are correct. Sorry for any confusion. Tom

Dopidotcsv commented 2 years ago

Hi Tom, It was just a typo in host in sascfg_personal.py. Thank you for you consideration and time!

tomweber-sas commented 2 years ago

Hey, that's great! I like the easy ones :) Thanks, Tom