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
367 stars 149 forks source link

saspy error to access the sas data #304

Closed bikashten closed 3 years ago

bikashten commented 4 years ago

Hello, I am using the remote desktop to access the sas and sas EG installed in my office desktop. The ultimate goal of my next project is 1. access the data in SASAPP server using SASPY in the python, manipulated them in python panda dataframe 2. import the the data created using json from a python to import into sas or save in the SASapp server for further analysis in SAS. Before jumping in to the SASApp data, I am using this simple code to access the data but I got stuck.

import saspy sas = saspy.SASsession()

Traceback (most recent call last): File "C:/Users/BBhandari2/Desktop/Python/template/dang2.py", line 2, in sas = saspy.SASsession() File "C:\Users\BBhandari2\Desktop\Python\template\venv\lib\site-packages\saspy\sasbase.py", line 485, in init raise SASIONotSupportedError(self.sascfg.mode, alts=['IOM']) saspy.sasexceptions.SASIONotSupportedError: Cannot use STDIO I/O module on Windows. Try the following: IOM

I am looking for a help.

tomweber-sas commented 4 years ago

Hey, that error showed that you haven't configured saspy. You are trying to use a local Windows install of SAS in you desktop, which requires you to use the IOM access method. You need java on the machine too, and that's about it. See the instructions here, and specifically IOM local. https://sassoftware.github.io/saspy/install.html#sascfg-personal-py https://sassoftware.github.io/saspy/install.html#iom-using-java Btw, I'm on vacation through next week, but I'll help you out as I can! Thanks, Tom

tomweber-sas commented 4 years ago

One thing I can't be sure of so far is if you are really trying to connect to a local SAS install on you PC, or a remote workspace server. Saspy can do both. You just have to provide the appropriate info in the config definition, per the documentation. Looking back, that was the problem in the other issue. @chungj001 was connecting locally (because that's the configuration being used), but wanted to connect to a remote server, different config needed. Which are you really trying to connect to?

bikashten commented 4 years ago

I am first trying to do it in the local machine. I used the same code as @chungj001 doing in the conversation in that thread like This is my code:

"I do not think I use remote desktop connection to connect to SAS server. import saspy sas = saspy.SASsession() cars = sas.sasdata("CARS","SASHELP") cars.describe() "

but I got the error as I mentioned earlier. I am trying to follow the steps in that conversation.

chungj001 commented 4 years ago

I recalled that I tried to use saspy to access SAS server. I suggest having clear documentation so that users can easily get into the world saspy.

Jason

On Fri, Jul 3, 2020 at 11:45 AM bikashten notifications@github.com wrote:

I am first trying to do it in the local machine. I used the same code as @chungj001 https://github.com/chungj001 doing in the conversation in that thread like This is my code. I do not think I use remote desktop connection to connect to SAS server. import saspy sas = saspy.SASsession() cars = sas.sasdata("CARS","SASHELP") cars.describe()

but I got the error as I mentioned earlier. I am trying to follow the steps in that conversation.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/304#issuecomment-653634101, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGGDWJM7FKM4CBNBO2TMFUDRZYKKBANCNFSM4OP2GMWQ .

tomweber-sas commented 4 years ago

Ok, so read the config doc. There are a lot of ways to connect to differently deployed SAS. So you have to provide a little info in the config file so I know where and how to connect. That needs to be done before you try to run any code. You can create one config def for local, and another for each remote server. I have like 30 in my sascfg_personal.py file 😎 For local, you do have to be running python on that machine. For local, all you really need is the java parm, and for remote, you still need the java parm plus the IOM host/port and your omr credentials.

bikashten commented 4 years ago

@tomweber-sas Thank you for your message. l would like to read the SASPY instruction again. It looks like we both have a good time after next week. I really need to fix this issue by end of July. You have a nice long weekend!!!!!

chungj001 commented 4 years ago

Hi, Bikashten,

Did you do all of your data analysis and statistical modeling work in saspy?

Jason

On Fri, Jul 3, 2020 at 12:36 PM bikashten notifications@github.com wrote:

@tomweber-sas https://github.com/tomweber-sas Thank you for your message. l would like to read the SASPY instruction again. It looks like we both have a good time after next week. I really need to fix this issue by end of July. You have a nice long weekend!!!!!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/304#issuecomment-653645484, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGGDWJMKYE6P4WF3H6BZMQTRZYQMJANCNFSM4OP2GMWQ .

bikashten commented 4 years ago

@chungj001 We are using both python and SAS for statistical analysis, but we have the data in SASAPP like you have in that thread. image

I can access this server by SAS EG, but we are trying to add the python capability on it. I am statistician and some times hard to understand the IT stuff.

bikashten commented 4 years ago

@chungj001 I would like to figure it out to get access the data in the SASApp using SASPY, but I have a hard time to understand sascfg.py and sascfg_personal.py. I think we have window client and with IWA so that I can use this code winiomIWA = {'java' : 'java', 'iomhost' : 'windows.iom.host', 'iomport' : 8591, 'encoding' : 'windows-1252',

'classpath' : cpW,

        'sspi'      : True
        }

to access the data. But, I am trying to figure it out. I have to work on it.

chungj001 commented 4 years ago

Why did you put all of your data in SAS server?

On Fri, Jul 3, 2020 at 1:42 PM bikashten notifications@github.com wrote:

@chungj001 https://github.com/chungj001 I would like to figure it out to get access the data in the SASApp using SASPY, but I have a hard time to understand sascfg.py and sascfg_personal.py. I think we have window client and with IWA so that I can use this code winiomIWA = {'java' : 'java', 'iomhost' : 'windows.iom.host', 'iomport' : 8591, 'encoding' : 'windows-1252',

'classpath' : cpW,

'sspi' : True } to access the data. But, I am trying to figure it out. I have to work on it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/304#issuecomment-653661667, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGGDWJI2H6NJOTOCCHSG6GLRZYYCHANCNFSM4OP2GMWQ .

bikashten commented 4 years ago

This is a way they put the data in SAS server. It is upper management decision. I know it is so easy to connect python and SQL server, but most of data for statistical analysis are in SAS server.

chungj001 commented 4 years ago

Within in SAS EG environment and even through saspy to do data wrangling the speed is way lower than doing the same work in SQL server. This is my experience.

On Fri, Jul 3, 2020 at 1:55 PM bikashten notifications@github.com wrote:

This is a way they put the data in SAS server. It is upper management decision. I know it is so easy to connect python and SQL server, but most of data for statistical analysis are in SAS server.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/304#issuecomment-653663837, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGGDWJK3JWIPLL6OQ4OG5P3RZYZSPANCNFSM4OP2GMWQ .

tomweber-sas commented 3 years ago

@bikashten did you get configured and connected?

bikashten commented 3 years ago

@tomweber-sas I have not started it yet. I am really busy with other projects. Once I have completed other projects, I will follow up you.

Thank you for your message !!!!!

bikashten commented 3 years ago

Good morning Tom, I am getting back to you. It has been a while, but I would like to remind you. I would like to access only the sas server "SASApp" data from the python in the window environment. I am using the IWA credentials set up in the SAS EG to access the SASAPP data from the SAS EG.

image

I read the sascfg_personal.py, but I got confused. I am not sure I understand correctly or not. It is basically I need to "copy the sascfg.py from the depo and edit it this section "# build out a local classpath variable to use below for Windows clients CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION" according to my local drive and use this configuration with my credentials.

winiomIWA = {'java' : 'java', 'iomhost' : 'windows.iom.host', 'iomport' : 8591, 'encoding' : 'windows-1252',

'classpath' : cpW,

        'sspi'      : True
        }

and save it in this folder saspy.SAScfg ... 'C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\sascfg.py'

Is it right? I am trying to figure it out. I need your suggestion.

Thank you, Bikash

tomweber-sas commented 3 years ago

Hey @bikashten So, it looks like you are close. Yes, you need to have a configuration definition in a config file that saspy will use. The name of the file should be sascfg_personal.py. It can be stored in a number of places, but putting it in the saspy install directory, same a the example file (sascfg.py) is the easiest. The contents of the file need be nothing more than this:

SAS_config_names = ['xxxx']

xxxx     = {'java'      : 'java',   # or the full path to java.exe if you don't have the path to it in your PATH environment variable
            'iomhost'   : 'p10sas01.rbcint.com',
            'iomport'   : 8591,
            'sspi'      : True,
            }           

Change xxx to whatever name you like. Put those few lines in a file named: C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\sascfg_personal.py

Are you sure that workspace server is configured to use IWA authentication, and not user/password? If so then sspi = True is correct. If not then you use the same user/pw that you have configured in EG, and remove the sspi key.

Can you try this and see if you can connect?

Tom

bikashten commented 3 years ago

@tomweber-sas Thank you for your message. I put the above mention code in the sascfg_personal.py like this: SAS_config_names = ['bikash_test']

bikash_test = {'java' : 'C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-openj9/bin/java.exe', # or the full path to java.exe if you don't have the path to it in your PATH environment variable 'iomhost' : 'p10sas01.rbcint.com', 'iomport' : 8591, 'sspi' : True, }

Then I ran the sas = saspy.SASsession(), but I still got this error.

sas = saspy.SASsession() Using SAS Config named: bikash_test Java Error: log4j:WARN No appenders could be found for logger (com.sas.services.connection). log4j:WARN Please initialize the log4j system properly. We failed in getConnection The native implementation module for the security package could not be found in the path. Subprocess failed to start. Double check your settings in sascfg_personal.py file. Attempted to run program C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-openj9/bin/java.exe with the following parameters:['C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-openj9/bin/java.exe', '-classpath', 'C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\saspyiom.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\log4j.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.security.sspi.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.core.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.svc.connection.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.nls.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sastpj.rutil.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\pfl-basic.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\pfl-tf.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '62806', '-stdoutport', '62807', '-stderrport', '62808', '-iomhost', 'p10sas01.rbcint.com', '-iomport', '8591', '-spn', '-lrecl', '1048576', ''] If no Java Error above, try running the following command (where saspy is running) manually to see if it's a problem starting Java: C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-openj9/bin/java.exe -classpath "C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\saspyiom.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\log4j.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.security.sspi.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.core.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.svc.connection.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.nls.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sastpj.rutil.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\pfl-basic.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\pfl-tf.jar" pyiom.saspy2j -host localhost -stdinport 62806 -stdoutport 62807 -stderrport 62808 -iomhost p10sas01.rbcint.com -iomport 8591 -spn -lrecl 1048576
No SAS process attached. SAS process has terminated unexpectedly. Invalid response from SAS on inital submission. printing the SASLOG as diagnostic Traceback (most recent call last): File "", line 1, in File "C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\sasbase.py", line 527, in init pyenc = sas_encoding_mapping[self.sascei] KeyError: 'No SAS process attached. SAS process has terminated unexpectedly.'

Dang, I am so closed, but It looks like a Java error, I double checked the Java path and my java path is correct.

bikashten commented 3 years ago

@tomweber-sas I have this setting in the SAS EG image

I think it is IWA, but I would like to confirm from you.

Thank you, Bikash

tomweber-sas commented 3 years ago

That's my bad. I forgot to tell you to put the path to the sspiauth.dll in you path variable. Since you are using IWA, you need that, same as if you were commenting to a local SAS session. Can you look at the doc for instruction on that? I'm just on my phone at the dentist right now. I can check back when I get back home. That info if here https://sassoftware.github.io/saspy/install.html#local

tomweber-sas commented 3 years ago

An alternate to putting that dir in your path, is to use this in your config file, with the correct path in your machine, of course

import os os.environ["PATH"] += ";C:\Program Files\SASHome\SASFoundation\9.4\core\sasext"

Make sure you use double backslashes in paths since you're on Windows. That's phon on Windows.

chungj001 commented 3 years ago

Bikash:

Are you a data engineer?

Jason

On Fri, Jul 24, 2020 at 8:11 AM bikashten notifications@github.com wrote:

@tomweber-sas https://github.com/tomweber-sas I have not started it yet. I am really busy with other projects. Once I have completed other projects, I will follow up you.

Thank you for your message !!!!!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/304#issuecomment-663558447, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGGDWJPSXU4JWUJM7HKTGFDR5GJCXANCNFSM4OP2GMWQ .

bikashten commented 3 years ago

@tomweber-sas I used above mentioned code, but it popped up the same error. Is there anything missing? My sascfg_personal.py look like this now:

SAS_config_names = ['bikash_test']

bikash_test = {'java' : 'C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-openj9/bin/java.exe', # or the full path to java.exe if you don't have the path to it in your PATH environment variable 'iomhost' : 'p10sas01.rbcint.com', 'iomport' : 8591, 'sspi' : True, }

import os os.environ["PATH"] += ";C:\Program Files\SASHome\SASFoundation\9.4\core\sasext"

sas = saspy.SASsession() Using SAS Config named: bikash_test Java Error: log4j:WARN No appenders could be found for logger (com.sas.services.connection). log4j:WARN Please initialize the log4j system properly. We failed in getConnection The native implementation module for the security package could not be found in the path. Subprocess failed to start. Double check your settings in sascfg_personal.py file. Attempted to run program C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-openj9/bin/java.exe with the following parameters:['C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-openj9/bin/java.exe', '-classpath', 'C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\saspyiom.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\log4j.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.security.sspi.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.core.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.svc.connection.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.nls.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sastpj.rutil.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\pfl-basic.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\pfl-tf.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '54101', '-stdoutport', '54102', '-stderrport', '54103', '-iomhost', 'p10sas01.rbcint.com', '-iomport', '8591', '-spn', '-lrecl', '1048576', ''] If no Java Error above, try running the following command (where saspy is running) manually to see if it's a problem starting Java: C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-openj9/bin/java.exe -classpath "C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\saspyiom.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\log4j.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.security.sspi.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.core.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.svc.connection.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.nls.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sastpj.rutil.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\pfl-basic.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\pfl-tf.jar" pyiom.saspy2j -host localhost -stdinport 54101 -stdoutport 54102 -stderrport 54103 -iomhost p10sas01.rbcint.com -iomport 8591 -spn -lrecl 1048576
No SAS process attached. SAS process has terminated unexpectedly. Invalid response from SAS on inital submission. printing the SASLOG as diagnostic Traceback (most recent call last): File "", line 1, in File "C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\sasbase.py", line 527, in init pyenc = sas_encoding_mapping[self.sascei] KeyError: 'No SAS process attached. SAS process has terminated unexpectedly.'

Kinda stuck.

bikashten commented 3 years ago

@tomweber-sas hold a second .

bikashten commented 3 years ago

I am using this sascfg_personal.py, but it popped up the same error.

SAS_config_names = ['bikash_test']

bikash_test = {'java' : 'C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-openj9/bin/java.exe', # or the full path to java.exe if you don't have the path to it in your PATH environment variable 'iomhost' : 'p10sas01.rbcint.com', 'iomport' : 8591, 'sspi' : True, }

import os os.environ["PATH"] += ";C:\Program Files\SASHome\SASFoundation\9.4\core\sasext"

sas = saspy.SASsession() Using SAS Config named: bikash_test Java Error: log4j:WARN No appenders could be found for logger (com.sas.services.connection). log4j:WARN Please initialize the log4j system properly. We failed in getConnection The native implementation module for the security package could not be found in the path. Subprocess failed to start. Double check your settings in sascfg_personal.py file. Attempted to run program C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-openj9/bin/java.exe with the following parameters:['C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-openj9/bin/java.exe', '-classpath', 'C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\saspyiom.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\log4j.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.security.sspi.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.core.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.svc.connection.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.nls.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sastpj.rutil.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\pfl-basic.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\pfl-tf.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '54223', '-stdoutport', '54224', '-stderrport', '54225', '-iomhost', 'p10sas01.rbcint.com', '-iomport', '8591', '-spn', '-lrecl', '1048576', ''] If no Java Error above, try running the following command (where saspy is running) manually to see if it's a problem starting Java: C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-openj9/bin/java.exe -classpath "C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\saspyiom.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\log4j.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.security.sspi.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.core.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.svc.connection.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sas.rutil.nls.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\iomclient\sastpj.rutil.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\pfl-basic.jar;C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\java\thirdparty\pfl-tf.jar" pyiom.saspy2j -host localhost -stdinport 54223 -stdoutport 54224 -stderrport 54225 -iomhost p10sas01.rbcint.com -iomport 8591 -spn -lrecl 1048576
No SAS process attached. SAS process has terminated unexpectedly. Invalid response from SAS on inital submission. printing the SASLOG as diagnostic Traceback (most recent call last): File "", line 1, in File "C:\Users\BBhandari2\Desktop\Python\python_SASPY\venv\lib\site-packages\saspy\sasbase.py", line 527, in init pyenc = sas_encoding_mapping[self.sascei] KeyError: 'No SAS process attached. SAS process has terminated unexpectedly.'

bikashten commented 3 years ago

I used double slash for os.environ["PATH"] + , but it shows single slash in the above message. Kinda strange. I just got stuck.

tomweber-sas commented 3 years ago

Yes, the whole backslash thing on windows is very annoying. 2 here shows 1 so you nee 4 to show 2. So, the error is still that it can't find that file. Do you actually have this file on your client machine? C:\Program Files\SASHome\SASFoundation\9.4\core\sasext\sspiauth.dll

tomweber-sas commented 3 years ago

This is the error about that file not being found; all the rest is just diagnostics, and not particularly relevant in this case. It' this IOM error: The native implementation module for the security package could not be found in the path.

bikashten commented 3 years ago

@tomweber-sas It looks like it is working. I restarted the pycharm and run the same code again. I got this message: sas = saspy.SASsession() Using SAS Config named: bikash_test SAS Connection established. Subprocess id is 32464 No encoding value provided. Will try to determine the correct encoding. Setting encoding to cp1252 based upon the SAS session encoding value of wlatin1.

tomweber-sas commented 3 years ago

Yes, if you added that path to your config, you would need to restart the python process for it to see the change. So then, you do have that file there, it would appear. Do you have SAS installed on that client? I'm guessing you do?

bikashten commented 3 years ago

@tomweber-sas I am not a tech guy, but I am using SAS and SAS EG installed in my computer. I am first time user for SASPY and am trying to import the data that are in the library under SASApp.

tomweber-sas commented 3 years ago

Well, now you should be connected to the same workspace server (definition) as EG connects to. So, if in EG you see pre-assigned libraries or other specific configuration, the same will be available in the server saspy is connecting to; it's the same SASApp workspace. Good deal!

bikashten commented 3 years ago

@tomweber-sas Great, I am now access to the data in the server. Thank you so much Tom.

@chungj001 I appreciate your time.

Have a good day!!!

Thank you, Bikash

tomweber-sas commented 3 years ago

I'm here to help; glad you're up and running! I'll close this, but if you need anything else, just open a new issue for what you need! Thanks! Tom