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 SAS-ODA Connection issue #518

Closed pkmedu closed 1 year ago

pkmedu commented 1 year ago

Import saspy works fine. The following code cell in Jupyter Lab gives me the error. I believe that is the issue.

Issue: with following code

import saspy sas_session = saspy.SASsession() sas_session ########################### sascfg_personal.py and _authinfo file content are shown at the end.

Using SAS Config named: oda We failed in getConnection An exception was thrown during the encryption key exchange.

SAS process has terminated unexpectedly. RC from wait was: 4294967290 SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file.

Attempted to run program C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe with the following parameters:['C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe', '-classpath', 'C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\saspyiom.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\iomclient\log4j-1.2-api-2.12.4.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\iomclient\log4j-api-2.12.4.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\iomclient\log4j-core-2.12.4.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\iomclient\sas.security.sspi.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\iomclient\sas.core.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\iomclient\sas.svc.connection.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\iomclient\sas.rutil.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\iomclient\sas.rutil.nls.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\iomclient\sastpj.rutil.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\thirdparty\pfl-basic.jar;C:\Users\pmuhuri\anaconda3\lib\site-packages\saspy\java\thirdparty\pfl-tf.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '54735', '-stdoutport', '54736', '-stderrport', '54737', '-iomhost', 'odaws01-usw2.oda.sas.com;odaws02-usw2.oda.sas.com;odaws03-usw2.oda.sas.com;odaws04-usw2.oda.sas.com', '-iomport', '8591', '-user', 'muhuri@gwu.edu', '-lrecl', '1048576', '']

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

sascfg_personal.py content

SAS_config_names=['oda'] oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }

_authinfo file content

oda user muhuri@gwu.edu password Something

tomweber-sas commented 1 year ago

That error is because ODA now requires SASPy to have 3 encryption jars in the classpath. That is documented here, so once you do that, I expect you'll be able to connect. Your configuration appears to be good! Tom

pkmedu commented 1 year ago

Thanks for your guidance. The addition of those 3 jars still provides the same error as follows. The connection issue has remained unresolved.

Using SAS Config named: oda We failed in getConnection An exception was thrown during the encryption key exchange.

SAS process has terminated unexpectedly. RC from wait was: 4294967290 SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file.

Questions: Are the classpath variable definitions and their placement plus the addition of 'classpath': cpW (last line) below correct? What am I doing wrong here?

##########

SAS_config_names=['oda']

cpW = "C:\Users\pmuhuri\anaconda3\Lib\site-packages\saspy\sas.rutil.jar" cpW += ";C:\Users\pmuhuri\anaconda3\Lib\site-packages\saspy\sas.rutil.nls.jar" cpW += ";C:\Users\pmuhuri\anaconda3\Lib\site-packages\saspy\sastpj.rutil.jar"

oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8', 'classpath' : cpW }

tomweber-sas commented 1 year ago

What you need to do is to get the 3 jar files and put them in the deployment. You don't try to provide part of the classpath in your config.

from the doc:

If you require the 3 encryption jars, shown below, they still need to be acquired from your SAS deployment, 
and then put in the saspy/java/iomclient directory of the saspy install (where the 4 included jars are) so they
will be included in the classpath for you.

Since you're trying to connect to ODA, I don't expect you have SAS available to get the files from it, so the instructions provide a link to download them:

Download, unzip and then copy them to the java/iomclient directory of the SASPy deployment,as explained above.
Encryption jar download: [https://support.sas.com/downloads](https://support.sas.com/downloads/package.htm?pid=2494).

delete that cpW classpath from your config and put the actual jar files into the java/iomclient directory in your saspy deployment; presumably in C:\Users\pmuhuri\anaconda3\Lib\site-packages\saspy\java\iomclient if the path you provided above is where saspy is installed (looks like it is). Do not provide 'classpath' in your config, just add the jar file to the install.

Thanks, Tom

pkmedu commented 1 year ago

Hello Tom,

Thank you so much for your further guidance. It worked this time! The issue is resolved. Pradip

On Mon, Jan 23, 2023 at 9:35 AM Tom Weber @.***> wrote:

What you need to do is to get the 3 jar files and put them in the deployment. You don't try to provide part of the classpath in your config.

from the doc:

If you require the 3 encryption jars, shown below, they still need to be acquired from your SAS deployment, and then put in the saspy/java/iomclient directory of the saspy install (where the 4 included jars are) so they will be included in the classpath for you.

Since you're trying to connect to ODA, I don't expect you have SAS available to get the files from it, so the instructions provide a link to download them:

Download, unzip and then copy them to the java/iomclient directory of the SASPy deployment,as explained above. Encryption jar download: https://support.sas.com/downloads.

delete that cpW classpath from your config and put the actual jar files into the java/iomclient directory in your saspy deployment; presumably in C:\Users\pmuhuri\anaconda3\Lib\site-packages\saspy\java\iomclient if the path you provided above is where saspy is installed (looks like it is). Do not provide 'classpath' in your config, just add the jar file to the install.

Thanks, Tom

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1400448900, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFQTN2FI6AOUMOIAKC3WT2JMBANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

That's great! I'm sorry there is now this extra requirement, but at least once you've done it, you're done and can just start using it. I'll go ahead and close this. Let me know if you need anything else. Thanks, Tom

pkmedu commented 1 year ago

On another laptop, I have the licensed version of SAS. SASPy and SAS (licensed version), with sascfg_personal.py, work fine via JupyterLab. To have a second connection (SASPy-SAS-ODA) in that laptop, how would I keep another sascfg_personal.py in the saspy subdirectory? Thanks for your continued support. Pradip

On Mon, Jan 23, 2023 at 9:54 AM Tom Weber @.***> wrote:

That's great! I'm sorry there is now this extra requirement, but at least once you've done it, you're done and can just start using it. I'll go ahead and close this. Let me know if you need anything else. Thanks, Tom

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1400484611, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFQUVOQCEX4HUATTPZ3WT2LTNANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

No problem, you don't have multiple config files, you have multiple Configuration Definitions in that one config file. Then when you want to connect to one or the other, or both, you say which one. If you look at the example config file, you'll see it has dozens of different ones So in your case you would have something like this in your config file:

SAS_config_names=['oda', 'local']

oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }

local = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe', }

Then when you issue SASsession() you can either specify which one, or it will prompt you for which one:

sas = saspy.SASsession(cfgname='local'); sas

Tom

From: pkmedu @.> Sent: Monday, January 23, 2023 10:08 AM To: sassoftware/saspy @.> Cc: Tom Weber @.>; State change @.> Subject: Re: [sassoftware/saspy] SASpy SAS-ODA Connection issue (Issue #518)

EXTERNAL On another laptop, I have the licensed version of SAS. SASPy and SAS (licensed version), with sascfg_personal.py, work fine via JupyterLab. To have a second connection (SASPy-SAS-ODA) in that laptop, how would I keep another sascfg_personal.py in the saspy subdirectory? Thanks for your continued support. Pradip

On Mon, Jan 23, 2023 at 9:54 AM Tom Weber @.<mailto:@.>> wrote:

That's great! I'm sorry there is now this extra requirement, but at least once you've done it, you're done and can just start using it. I'll go ahead and close this. Let me know if you need anything else. Thanks, Tom

- Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1400484611, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFQUVOQCEX4HUATTPZ3WT2LTNANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.<mailto:@.>>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.<mailto:@.>

- Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsassoftware%2Fsaspy%2Fissues%2F518%23issuecomment-1400504609&data=05%7C01%7Ctom.weber%40sas.com%7C274e9abaf73c4580fbb308dafd539ea9%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C638100832855598804%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=0RSVm%2FQssNjxGhLNykEz%2BSGet2YO4fS1jB59E5hALHA%3D&reserved=0, or unsubscribehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAEHDYZXLCLB7DI4IMNGVHALWT2NFBANCNFSM6AAAAAAUDGJFFE&data=05%7C01%7Ctom.weber%40sas.com%7C274e9abaf73c4580fbb308dafd539ea9%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C638100832855598804%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GunMzuFlpWDlcUhU6CEMCwTu3p0X%2Bz5JIU6SDpeBFzI%3D&reserved=0. You are receiving this because you modified the open/close state.Message ID: @.**@.>>

pkmedu commented 1 year ago

Hello Tom,

With my revised sascfg_personal.py (attached - one file with two different configuration definitions), I find the SAS connection established for both 'oda' and 'winlocal' . Issue: When I use the SAS kernel (for the licensed version of SAS), I find the following error. Any guidance would be appreciated. Thanks, Pradip

[image: image.png]

On Mon, Jan 23, 2023 at 10:26 AM Tom Weber @.***> wrote:

No problem, you don't have multiple config files, you have multiple Configuration Definitions in that one config file. Then when you want to connect to one or the other, or both, you say which one. If you look at the example config file, you'll see it has dozens of different ones So in your case you would have something like this in your config file:

SAS_config_names=['oda', 'local']

oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }

local = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe', }

Then when you issue SASsession() you can either specify which one, or it will prompt you for which one:

sas = saspy.SASsession(cfgname='local'); sas

Tom

From: pkmedu @.> Sent: Monday, January 23, 2023 10:08 AM To: sassoftware/saspy @.> Cc: Tom Weber @.>; State change @.> Subject: Re: [sassoftware/saspy] SASpy SAS-ODA Connection issue (Issue

518)

EXTERNAL On another laptop, I have the licensed version of SAS. SASPy and SAS (licensed version), with sascfg_personal.py, work fine via JupyterLab. To have a second connection (SASPy-SAS-ODA) in that laptop, how would I keep another sascfg_personal.py in the saspy subdirectory? Thanks for your continued support. Pradip

On Mon, Jan 23, 2023 at 9:54 AM Tom Weber @.<mailto:@.>> wrote:

That's great! I'm sorry there is now this extra requirement, but at least once you've done it, you're done and can just start using it. I'll go ahead and close this. Let me know if you need anything else. Thanks, Tom

- Reply to this email directly, view it on GitHub <https://github.com/sassoftware/saspy/issues/518#issuecomment-1400484611 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AIXDQFQUVOQCEX4HUATTPZ3WT2LTNANCNFSM6AAAAAAUDGJFFE

. You are receiving this because you authored the thread.Message ID: @.<mailto:@.>>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.<mailto:@.>

- Reply to this email directly, view it on GitHub< https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsassoftware%2Fsaspy%2Fissues%2F518%23issuecomment-1400504609&data=05%7C01%7Ctom.weber%40sas.com%7C274e9abaf73c4580fbb308dafd539ea9%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C638100832855598804%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=0RSVm%2FQssNjxGhLNykEz%2BSGet2YO4fS1jB59E5hALHA%3D&reserved=0>, or unsubscribe< https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAEHDYZXLCLB7DI4IMNGVHALWT2NFBANCNFSM6AAAAAAUDGJFFE&data=05%7C01%7Ctom.weber%40sas.com%7C274e9abaf73c4580fbb308dafd539ea9%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C638100832855598804%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GunMzuFlpWDlcUhU6CEMCwTu3p0X%2Bz5JIU6SDpeBFzI%3D&reserved=0

. You are receiving this because you modified the open/close state.Message ID: @.**@.>>

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1400536763, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFUTDYRKGT4DVAYS6Q3WT2PLTANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

I don't see the error. The picture didn't come through.

pkmedu commented 1 year ago

1) sascfg_personal_win.txt, when renamed sascfg_personal.py, works fine when I run the licensed version of SAS using the SAS kernel in JupyterLab. proc print data=sashelp.class; run; Question 1: Do you see any redundancies in the code (sascfg_personal_win.txt)?

2) sascfg_personal_oda.txt, when renamed sascfg_personal.py, works fine when I run SAS ODA in JupyterLab. import saspy sas_session = saspy.SASsession(); sas_session %%SAS proc print data=sashelp.class; run; Question 2: Is %%SAS always required when using the SAS ODA? 3) sascfg_personal.py (one config file with two configuration definitions) does not seem to work. Question 3: What am I doing wrong with the code in this .py file?

Thank you for your continued support. Pradip

On Tue, Jan 24, 2023 at 9:48 AM Tom Weber @.***> wrote:

Reopened #518 https://github.com/sassoftware/saspy/issues/518.

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#event-8345071338, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFQXXOO462PLAKMJ2C3WT7TTNANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

SAS_config_names=['winlocal']

default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }

build out a local classpath variable to use below for Windows clients CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION

cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\Users\pmuhuri\anaconda3\New folder\Lib\site-packages\saspy\java\saspyiom.jar"

winlocal = {'java' : 'java', 'encoding' : 'windows-1252', 'classpath' : cpW }

SAS_config_names

SAS_config_names=['oda']

oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }

tomweber-sas commented 1 year ago

I don't see anything you're trying to provide. No config info, No idea of what you are seeing in jupyter. Can you post your config and show me the code you're submitting and the output it produces. And no, I never use that %%SAS thing. SASPy has real methods for submitting code and doing all kinds of things. It's all in the doc, but lets start with actually seeing what problem you're having. However it is you're trying to post that info here isn't working.

pkmedu commented 1 year ago

Hello, In my previous email, I sent you three attachments (sascfg_persons.py - 3 versions), which I am presenting below.

Issue: The single config file (sascfg_personal.py) with multiple configuration definitions (version 1) works only for SAS ODA, not for the licensed SAS.

Versions 2 and 3 (also shown below) work fine.

1) Single config file for multiple configuration definitions (oda and winlocal) ################################# SAS_config_names=['oda', 'winlocal']

oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }

winlocal = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe', }

default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }

cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\Users\pmuhuri\anaconda3\New folder\Lib\site-packages\saspy\java\saspyiom.jar"

winlocal = {'java' : 'java', 'encoding' : 'windows-1252', 'classpath' : cpW } 2) Config file for oda (works fine)

SAS_config_names=['oda'] oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }

3) Config file for win local (works fine) SAS_config_names=['winlocal'] default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }

cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\Users\pmuhuri\anaconda3\New folder\Lib\site-packages\saspy\java\saspyiom.jar"

winlocal = {'java' : 'java', 'encoding' : 'windows-1252', 'classpath' : cpW }

Thanks,

pkmedu commented 1 year ago

Continuation of my previous comments

Issue: The code did not prompt for the choice - oda versus winlocal. import saspy sas_session = saspy.SASsession(); sas_session

Using SAS Config named: oda SAS Connection established. Subprocess id is 16428

Access Method = IOM SAS Config name = oda SAS Config file = C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\sascfg_personal.py WORK Path = /saswork/SAS_work9D7C00007BF5_odaws01-usw2.oda.sas.com/SAS_work825000007BF5_odaws01-usw2.oda.sas.com/ SAS Version = 9.04.01M7P08062020 SASPy Version = 4.3.0 Teach me SAS = False Batch = False Results = Pandas SAS Session Encoding = utf-8 Python Encoding value = utf-8 SAS process Pid value = 31733

tomweber-sas commented 1 year ago

You aren't emailing me anything. You are posting to an issue on github. 'replying' to an email from github just posts what you email back on the issue. Try looking at the issue: https://github.com/sassoftware/saspy/issues/518

That's hard to read, but I don't understand why you have classpaths in any of those. I don't see how the one with that classpath can work for ODA, since that classpath doesn't have the encryption jars in it. By specifying classpath you're overriding the correct one saspy generates itself.

What error do you get trying to use the 1st config?

tomweber-sas commented 1 year ago

Issue: The code did not prompt for the choice - oda versus winlocal.

Ok, that helps. So you're probably not using the config you think you are. run the following:

import saspy
saspy.list_configs()
saspy.SAScfg

and show me the results.

tomweber-sas commented 1 year ago

Well, it already shows you which one it used. So try the following:

import saspy
fd = open(saspy.SAScfg)
cfg = fd.read()
fd.close()
print(cfg)

Then we'll see what's in the file it's using

pkmedu commented 1 year ago

import saspy saspy.list_configs() saspy.SAScfg

Results

'C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\sascfg_personal.py'

SAS_config_names=['oda', 'winlocal']

oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' } winlocal = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe', }

default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }

build out a local classpath variable to use below for Windows

clients CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\Users\pmuhuri\anaconda3\New folder\Lib\site-packages\saspy\java\saspyiom.jar"

winlocal = {'java' : 'java', 'encoding' : 'windows-1252', 'classpath' : cpW }

On Tue, Jan 24, 2023 at 3:40 PM Tom Weber @.***> wrote:

Issue: The code did not prompt for the choice - oda versus winlocal.

Ok, that helps. So you're probably not using the config you think you are. run the following:

import saspy saspy.list_configs() saspy.SAScfg

and show me the results.

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1402619678, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFUFD7Q63NBAY34I5O3WUA45RANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

pkmedu commented 1 year ago

import saspy fd = open(saspy.SAScfg) cfg = fd.read() fd.close() print(cfg)

Results:

SAS_config_names=['oda', 'winlocal']

oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }

winlocal = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe', }

default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }

build out a local classpath variable to use below for Windows

clients CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\Users\pmuhuri\anaconda3\New folder\Lib\site-packages\saspy\java\saspyiom.jar"

winlocal = {'java' : 'java', 'encoding' : 'windows-1252', 'classpath' : cpW }

On Tue, Jan 24, 2023 at 3:44 PM Tom Weber @.***> wrote:

Well, it already shows you which one it used. So try the following:

import saspy fd = open(saspy.SAScfg) cfg = fd.read() fd.close() print(cfg)

Then we'll see what's in the file it's using

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1402626067, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFTKH7JLRDAE3PTCXYDWUA5LJANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

First, delete all of this.

default  = {'saspath'  : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8'
            }

# build out a local classpath variable to use below for Windows
clients   CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION
cpW  =  "C:\\Program
Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94582__prt__xx__sp0__1\\deploywiz\\sas.svc.connection.jar"
cpW += ";C:\\Program
Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94582__prt__xx__sp0__1\\deploywiz\\log4j.jar"
cpW += ";C:\\Program
Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94582__prt__xx__sp0__1\\deploywiz\\sas.security.sspi.jar"
cpW += ";C:\\Program
Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94582__prt__xx__sp0__1\\deploywiz\\sas.core.jar"
cpW += ";C:\\Users\\pmuhuri\\anaconda3\\New
folder\\Lib\\site-packages\\saspy\\java\\saspyiom.jar"

winlocal = {'java'      : 'java',
            'encoding'  : 'windows-1252',
            'classpath' : cpW
            }

What happens when you try the following? I don't know how you wouldn't get prompted since there are 2 listed in the SAS_config_names list. sas = saspy.SASsession(cfgname='winlocal')

What python interface are you typing this into?

pkmedu commented 1 year ago

Python Interface: JupyterLab

import saspy sas_session = saspy.SASsession('winlocal'); sas_session

Results

---------------------------------------------------------------------------TypeError Traceback (most recent call last)~\AppData\Local\Temp/ipykernel_7076/4041293087.py in 1 import saspy----> 2 sas = saspy.SASsession('winlocal'); 3 sas

import saspy sas_session = saspy.SASsession('oda'); sas_session

--------------------------------------------------------------------------TypeError Traceback (most recent call last)~\AppData\Local\Temp/ipykernel_7076/573851270.py in 1 import saspy----> 2 sas_session = saspy.SASsession('oda'); 3 sas_session TypeError: init() takes 1 positional argument but 2 were given

import saspy sas_session = saspy.SASsession(); sas_session

Using SAS Config named: oda SAS Connection established. Subprocess id is 18108

[12]:

Access Method = IOM SAS Config name = oda SAS Config file = C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\sascfg_personal.py WORK Path = /saswork/SAS_work656B00004137_odaws04-usw2.oda.sas.com/SAS_work18A600004137_odaws04-usw2.oda.sas.com/ SAS Version = 9.04.01M7P08062020 SASPy Version = 4.3.0 Teach me SAS = False Batch = False Results = Pandas SAS Session Encoding = utf-8 Python Encoding value = utf-8 SAS process Pid value = 16695

On Tue, Jan 24, 2023 at 3:58 PM Tom Weber @.***> wrote:

First, delete all of this.

default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }

build out a local classpath variable to use below for Windows

clients CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\Users\pmuhuri\anaconda3\New folder\Lib\site-packages\saspy\java\saspyiom.jar"

winlocal = {'java' : 'java', 'encoding' : 'windows-1252', 'classpath' : cpW }

What happens when you try the following? I don't know how you wouldn't get prompted since there are 2 listed in the SAS_config_names list. sas = saspy.SASsession(cfgname='winlocal')

What python interface are you typing this into?

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1402645842, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFSU2XSGH7VQNMPXLILWUA66RANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

I don't see any output of any kind. I didn't see any output from saspy.list_configs() in the previous post either. You're on windows, so can you open a command prompt and run python? Then maybe I can see the code and what actually gets output? What happened when you ran what you just posted above?

tomweber-sas commented 1 year ago

Oh, there was somehting I had to click to expand it. Let me look though it to see what I can see ...

pkmedu commented 1 year ago

Please take your time. Thanks for your continued support.

On Tue, Jan 24, 2023 at 4:26 PM Tom Weber @.***> wrote:

Oh, there was somehting I had to click to expand it. Let me look though it to see what I can see ...

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1402689972, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFQDWRTHF6QPIYYQ7LLWUBCIPANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

ok, well those were just syntax errors. You didn't run this. sas = saspy.SASsession(cfgname='winlocal')

Can you run this in a shell so I can see the code and output for real?

import saspy
saspy
saspy.list_configs()
saspy.SAScfg
sas = saspy.SASsession(cfgname='winlocal')
sas
sas.sascfg.SAScfg.SAS_config_names

the output should resemble this:

C:\Users\sastpw>python
Python 3.11.1 (tags/v3.11.1:a7a450f, Dec  6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import saspy
>>> saspy
<module 'saspy' from 'C:\\Users\\sastpw\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\saspy\\__init__.py'>
>>> saspy.list_configs()
['C:\\Users\\sastpw\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\saspy\\sascfg_personal.py', 'C:\\Users\\sastpw/.config/saspy\\sascfg_personal.py']
>>> saspy.SAScfg
'C:\\Users\\sastpw\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\saspy\\sascfg_personal.py'
>>> sas = saspy.SASsession(cfgname='winlocal')
SAS Connection established. Subprocess id is 14416

>>> sas
Access Method         = IOM
SAS Config name       = winlocal
SAS Config file       = C:\Users\sastpw\AppData\Local\Programs\Python\Python311\Lib\site-packages\saspy\sascfg_personal.py
WORK Path             = C:\Users\sastpw\AppData\Local\Temp\SAS Temporary Files\_TD26228_d10a626_\Prc2\
SAS Version           = 9.04.01M5P09132017
SASPy Version         = 4.4.3
Teach me SAS          = False
Batch                 = False
Results               = Pandas
SAS Session Encoding  = utf-8
Python Encoding value = utf8
SAS process Pid value = 26228

>>> sas.sascfg.SAScfg.SAS_config_names
['default', 'SASgrid', 'http', 'httptest', 'ssh', 'sshrtun', 'httpfred', 'grid', 'tdi', 'iomj', 'iomc', 'iomjwin', 'winiomj', 'winiomjwin', 'winlocal', 'gridiom', 'wingridiom', 'zos', 'zos2', 'winzos', 'winzos2', 'winiomIWA', 'winiomjcom', 'pune', 'pune2', 'notpune', 'iomcom', 'iomcom_loc', 'iomcom_auth', 'itviya', 'carrie1', 'testmkt', 'testmktCOM', 'oda', 'odatom', 'odadev', 'ssh_cn', 'SGF_Viya', 'dotat', 'dotav', 'dotap', 'dotas', 'dotat_cn', 'sso', 'jh']
>>>
pkmedu commented 1 year ago

Thank you for correcting my syntax errors. For the first code chunk, my results are similar to yours. For the last code chunk (sas.sascfg.SAScfg.SAS_config_names), my results are different.

sas.sascfg.SAScfg.SAS_config_names ['oda', 'winlocal'] Please see below.

(base) PS C:\Users\pmuhuri> python Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information.

import saspy saspy <module 'saspy' from 'C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\init.py'> saspy.list_configs() ['C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\sascfg_personal.py'] saspy.SAScfg 'C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\sascfg_personal.py' sas = saspy.SASsession(cfgname='winlocal') SAS Connection established. Subprocess id is 8308

sas Access Method = IOM SAS Config name = winlocal SAS Config file = C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\sascfg_personal.py WORK Path = C:\Users\pmuhuri\AppData\Local\Temp\SAS Temporary Files_TD17288CCASTA-HWJP0G2\Prc2\ SAS Version = 9.04.01M7P08052020 SASPy Version = 4.3.0 Teach me SAS = False Batch = False Results = Pandas SAS Session Encoding = wlatin1 Python Encoding value = windows-1252 SAS process Pid value = 17288

sas.sascfg.SAScfg.SAS_config_names ['oda', 'winlocal']

JupyterLab

import saspy saspy saspy.list_configs() saspy.SAScfg sas = saspy.SASsession(cfgname='winlocal') sas

SAS Connection established. Subprocess id is 3732

[2]:

Access Method = IOM SAS Config name = winlocal SAS Config file = C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\sascfg_personal.py WORK Path = C:\Users\pmuhuri\AppData\Local\Temp\SAS Temporary Files_TD4668CCASTA-HWJP0G2\Prc2\ SAS Version = 9.04.01M7P08052020 SASPy Version = 4.3.0 Teach me SAS = False Batch = False Results = Pandas SAS Session Encoding = wlatin1 Python Encoding value = windows-1252 SAS process Pid value = 4668

[3]:

1

sas.sascfg.SAScfg.SAS_c

JupyterLab

sas.sascfg.SAScfg.SAS_config_names

['oda', 'winlocal']

On Tue, Jan 24, 2023 at 4:37 PM Tom Weber @.***> wrote:

ok, well those were just syntax errors. You didn't run this. sas = saspy.SASsession(cfgname='winlocal')

Can you run this in a shell so I can see the code and output for real?

import saspy saspy saspy.list_configs() saspy.SAScfg sas = saspy.SASsession(cfgname='winlocal') sas sas.sascfg.SAScfg.SAS_config_names

the output should resemble this:

C:\Users\sastpw>python Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import saspy saspy <module 'saspy' from 'C:\Users\sastpw\AppData\Local\Programs\Python\Python311\Lib\site-packages\saspy\init.py'> saspy.list_configs() ['C:\Users\sastpw\AppData\Local\Programs\Python\Python311\Lib\site-packages\saspy\sascfg_personal.py', 'C:\Users\sastpw/.config/saspy\sascfg_personal.py'] saspy.SAScfg 'C:\Users\sastpw\AppData\Local\Programs\Python\Python311\Lib\site-packages\saspy\sascfg_personal.py' sas = saspy.SASsession(cfgname='winlocal') SAS Connection established. Subprocess id is 14416

sas Access Method = IOM SAS Config name = winlocal SAS Config file = C:\Users\sastpw\AppData\Local\Programs\Python\Python311\Lib\site-packages\saspy\sascfg_personal.py WORK Path = C:\Users\sastpw\AppData\Local\Temp\SAS Temporary Files_TD26228d10a626\Prc2\ SAS Version = 9.04.01M5P09132017 SASPy Version = 4.4.3 Teach me SAS = False Batch = False Results = Pandas SAS Session Encoding = utf-8 Python Encoding value = utf8 SAS process Pid value = 26228

sas.sascfg.SAScfg.SAS_config_names ['default', 'SASgrid', 'http', 'httptest', 'ssh', 'sshrtun', 'httpfred', 'grid', 'tdi', 'iomj', 'iomc', 'iomjwin', 'winiomj', 'winiomjwin', 'winlocal', 'gridiom', 'wingridiom', 'zos', 'zos2', 'winzos', 'winzos2', 'winiomIWA', 'winiomjcom', 'pune', 'pune2', 'notpune', 'iomcom', 'iomcom_loc', 'iomcom_auth', 'itviya', 'carrie1', 'testmkt', 'testmktCOM', 'oda', 'odatom', 'odadev', 'ssh_cn', 'SGF_Viya', 'dotat', 'dotav', 'dotap', 'dotas', 'dotat_cn', 'sso', 'jh']

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1402720017, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFROB7NF6BHTBC6QMI3WUBDQ5ANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

well that all worked. So what happens when you just run this in a shell?

import saspy
sas = saspy.SASsession()

You should see something like this:

>>> sas = saspy.SASsession()
Please enter the name of the SAS Config you wish to run. Available Configs are: ['default', 'SASgrid', 'http', 'httptest', 'ssh', 'sshrtun', 'httpfred', 'grid', 'tdi', 'iomj', 'iomc', 'iomjwin', 'winiomj', 'winiomjwin', 'winlocal', 'gridiom', 'wingridiom', 'zos', 'zos2', 'winzos', 'winzos2', 'winiomIWA', 'winiomjcom', 'pune', 'pune2', 'notpune', 'iomcom', 'iomcom_loc', 'iomcom_auth', 'itviya', 'carrie1', 'testmkt', 'testmktCOM', 'oda', 'odatom', 'odadev', 'ssh_cn', 'SGF_Viya', 'dotat', 'dotav', 'dotap', 'dotas', 'dotat_cn', 'sso', 'jh'] winlocal
SAS Connection established. Subprocess id is 16256

>>>

Of course, you would only have ['oda', 'winlocal'].

What about by itself in a cell in your jupyter?

image

You don't want to put more then one line of code, that generates output, in a single cell. Jupyter doesn't necessarily display but the last output. So, don't pile a bunch of code all i n a single cell. Without providing cfgname= on the SASsession() you should be prompted.

pkmedu commented 1 year ago

Thank you for mentioning not putting more than one line of code. Yes, I am prompted. Why am I getting this? The SAS Config name specified was not found.

import saspy sas = saspy.SASsession() Please enter the name of the SAS Config you wish to run. Available Configs are: ['oda', 'winlocal'] 'oda' The SAS Config name specified was not found. Please enter the SAS Config you wish to use. Available Configs are: ['oda', 'winlocal']

On Tue, Jan 24, 2023 at 5:13 PM Tom Weber @.***> wrote:

well that all worked. So what happens when you just run this in a shell?

import saspy sas = saspy.SASsession()

You should see something like this:

sas = saspy.SASsession() Please enter the name of the SAS Config you wish to run. Available Configs are: ['default', 'SASgrid', 'http', 'httptest', 'ssh', 'sshrtun', 'httpfred', 'grid', 'tdi', 'iomj', 'iomc', 'iomjwin', 'winiomj', 'winiomjwin', 'winlocal', 'gridiom', 'wingridiom', 'zos', 'zos2', 'winzos', 'winzos2', 'winiomIWA', 'winiomjcom', 'pune', 'pune2', 'notpune', 'iomcom', 'iomcom_loc', 'iomcom_auth', 'itviya', 'carrie1', 'testmkt', 'testmktCOM', 'oda', 'odatom', 'odadev', 'ssh_cn', 'SGF_Viya', 'dotat', 'dotav', 'dotap', 'dotas', 'dotat_cn', 'sso', 'jh'] winlocal SAS Connection established. Subprocess id is 16256

Of course, you would only have ['oda', 'winlocal'].

What about by itself in a cell in your jupyter?

[image: image] https://user-images.githubusercontent.com/17710182/214432767-15b00bf3-309f-4a32-b036-38c7468c1114.png

You don't want to put more then one line of code, that generates output, in a single cell. Jupyter doesn't necessarily display but the last output. So, don't pile a bunch of code all i n a single cell. Without providing cfgname= on the SASsession() you should be prompted.

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1402761531, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFTOPSQORRTN3Y23DVDWUBHYDANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

did you type in quotes? don't do that

tomweber-sas commented 1 year ago

Now that you have it working, here's the API reference: https://sassoftware.github.io/saspy/api.html and go look at this example Notebook (which you can download and run yourself), here: https://github.com/sassoftware/saspy-examples/blob/main/SAS_contrib/Ask_the_Expert_Demo.ipynb That will get you a long way with using this if you read through these and see what it's doing and how it works!

pkmedu commented 1 year ago

The following code works.

import saspy sas = saspy.SASsession()

Please enter the name of the SAS Config you wish to run. Available Configs are: ['oda', 'winlocal'] winlocal

SAS Connection established. Subprocess id is 13408

The subsequent code block gives me error.

proc print data=sashelp.class; run;

File "C:\Users\pmuhuri\AppData\Local\Temp/ipykernel_1096/1087705766.py", line 1 proc print data=sashelp.class; run;

On Tue, Jan 24, 2023 at 5:34 PM Tom Weber @.***> wrote:

did you type in quotes? don't do that

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1402780427, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFXNCOQB4RFN6BCHW5TWUBKIDANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

That's not python.

pkmedu commented 1 year ago

I agree. How would I run the pure SAS code with ' winlocal'?

On Tue, Jan 24, 2023 at 5:44 PM Tom Weber @.***> wrote:

That's not python.

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1402788087, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFUQ525BVDA7A2Y5WW3WUBLNXANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

If you don't want to write python code and integrate SAS with python, then you can install the sas_kernel and use it in jupyter. pip install sas_kernel Then restart jupyter (the whoile jupyter server, not just refresh a notebook page). Restart Juypyter. Then you should see a choice of Kernels (what language a notebook executes), one for Python and one for SAS. Choose SAS then it will use saspy under the covers to submit the code for you.

image

Or, if you want to use python, you can use saspy like you're doing now, and just submit code via:

sas.submitLST('''
data a;
  x=1;
run;

proc print; run;
''')
pkmedu commented 1 year ago

Yes, I do have the SAS_kernel installed. I have restarted Jupyter and used the SAS kernel. I get the following error. Is it due to the single config file with multiple configuration definitions (oda and winlocal)?

proc print data=sashelp.class; run;

[<class 'TypeError'>, TypeError("Frame 0 ({'shell': [b'd6bb9178-6175-4aa3-...) does not support the buffer interface."), <traceback object at 0x000002DABAC87F00>]

On Tue, Jan 24, 2023 at 5:54 PM Tom Weber @.***> wrote:

If you don't want to write python code and integrate SAS with python, then you can install the sas_kernel and use it in jupyter. pip install sas_kernel Then restart jupyter (the whoile jupyter server, not just refresh a notebook page). Restart Juypyter. Then you should see a choice of Kernels (what language a notebook executes), one for Python and one for SAS. Choose SAS then it will use saspy under the covers to submit the code for you.

[image: image] https://user-images.githubusercontent.com/17710182/214438883-fe1b5755-25cd-4e2a-b591-6f3c00392f0e.png

Or, if you want to use python, you can use saspy like you're doing now, and just submit code via:

sas.submitLST(''' data a; x=1; run;

proc print; run; ''')

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1402795168, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFVRAAPG7HSF52MPETTWUBMRNANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

I believe I fixed that bug in the sas_kernel not long ago. try the following and then restart again and give it another try.

pip uninstall -y sas_kernel
pip install sas_kernel

That should get the current production version with the fix for that problem; something changed in the interface in jupyter recently that broke prompting, and I fixed it in the current version.

tomweber-sas commented 1 year ago

Actually, looking to find that, I believe the fix for that case was actually in saspy, so uninstall it and sas_kernel (get the latest production versions of both), and then try it again. With the current versions of both, you should be up and running.

pkmedu commented 1 year ago

!pip show sas_kernel

Name: SAS-kernel Version: 2.4.11 Summary: A SAS kernel for Jupyter Home-page: https://github.com/sassoftware/sas_kernel Author: Jared Dean Author-email: @.*** License: Apache Software License Location: c:\users\pmuhuri\anaconda3\new folder\lib\site-packages Requires: ipython, saspy, jupyter-client, metakernel Required-by:

[ ]: 1

The current SAS_kernel version on my machine is 2.4.11. What version would I need? Shall I run the following on the Python prompt or use JupterLab (IPython notebook) with a preceding !?

pip uninstall -y sas_kernel pip install sas_kernel

On Tue, Jan 24, 2023 at 6:43 PM Tom Weber @.***> wrote:

I believe I fixed that bug in the sas_kernel not long ago. try the following and then restart again and give it another try.

pip uninstall -y sas_kernel pip install sas_kernel

That should get the current production version with the fix for that problem; something changed in the interface in jupyter recently that broke prompting, and I fixed it in the current version.

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1402835479, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFTRUUT5B333QAMVGILWUBSKRANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

pkmedu commented 1 year ago

!pip show saspy

Name: saspy Version: 4.3.0 Summary: A Python interface to SAS Home-page: https://github.com/sassoftware/saspy Author: Tom Weber Author-email: @.*** License: UNKNOWN Location: c:\users\pmuhuri\anaconda3\new folder\lib\site-packages Requires: Required-by: SAS-kernel

[ ]: 1

The current version of SASPy is 4.3.0. What is the latest version of SASPy we currently have?

On Tue, Jan 24, 2023 at 7:34 PM Pradip Muhuri @.***> wrote:

!pip show sas_kernel

Name: SAS-kernel Version: 2.4.11 Summary: A SAS kernel for Jupyter Home-page: https://github.com/sassoftware/sas_kernel Author: Jared Dean Author-email: @.*** License: Apache Software License Location: c:\users\pmuhuri\anaconda3\new folder\lib\site-packages Requires: ipython, saspy, jupyter-client, metakernel Required-by:

[ ]: 1

The current SAS_kernel version on my machine is 2.4.11. What version would I need? Shall I run the following on the Python prompt or use JupterLab (IPython notebook) with a preceding !?

pip uninstall -y sas_kernel pip install sas_kernel

On Tue, Jan 24, 2023 at 6:43 PM Tom Weber @.***> wrote:

I believe I fixed that bug in the sas_kernel not long ago. try the following and then restart again and give it another try.

pip uninstall -y sas_kernel pip install sas_kernel

That should get the current production version with the fix for that problem; something changed in the interface in jupyter recently that broke prompting, and I fixed it in the current version.

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1402835479, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFTRUUT5B333QAMVGILWUBSKRANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

you run pip from a command line. How did you install those versions?

run it from a command prompt. uninstall and install, like I showed. That will get the current production versions.

pip uninstall -y sas_kernel
pip uninstall -y saspy
pip install saspy
pip install sas_kernel

Just run that from the command line.

pkmedu commented 1 year ago

SyntaxError: invalid syntax

import pip pip uninstall -y sas_kernel File "", line 1 pip uninstall -y sas_kernel

Why am I getting the above syntax error? How to correct it?

On Tue, Jan 24, 2023 at 8:06 PM Tom Weber @.***> wrote:

you run pip from a command line. How did you install those versions?

run it from a command prompt. uninstall and install, like I showed. That will get the current production versions.

pip uninstall -y sas_kernel pip uninstall -y saspy pip install saspy pip install sas_kernel

Just run that from the command line.

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1402906138, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFRYPE4CGY2WBZ4TT23WUB4CHANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

Because you are typing those commands into Python. Get out of python. Open a shell, a command prompt, like when we ran line mode python to see that the prompting works right. C:\> pip command

How did you install saspy in the first place?

pkmedu commented 1 year ago

Probably from within JupyterLab !pip install saspy

On Tue, Jan 24, 2023 at 10:16 PM Tom Weber @.***> wrote:

Because you are typing those commands into Python. Get out of python. Open a shell, a command prompt, like when we ran line mode python to see that the prompting works right. C:> pip command

How did you install saspy in the first place?

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1403042520, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFUYQSPYTHSRBV3KSZDWUCLILANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

Can you type in the command at a command prompt? C:\> Or any way you can. Just install the current release.

pkmedu commented 1 year ago

saspy and sas_kernel are installed here:

c:\users\pmuhuri\anaconda3\new folder\lib\site-packages

On Tue, Jan 24, 2023 at 10:28 PM Pradip Muhuri @.***> wrote:

Probably from within JupyterLab !pip install saspy

On Tue, Jan 24, 2023 at 10:16 PM Tom Weber @.***> wrote:

Because you are typing those commands into Python. Get out of python. Open a shell, a command prompt, like when we ran line mode python to see that the prompting works right. C:> pip command

How did you install saspy in the first place?

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1403042520, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFUYQSPYTHSRBV3KSZDWUCLILANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

Yes, that is where they are installed. Did you update them to the current versions? Does the SAS_kernel now prompt correctly so you can use it like you want?

pkmedu commented 1 year ago

Hello Tom,

I have updated them. Please see below.

Name: saspy Version: 4.5.0 Summary: A Python interface to SAS Home-page: https://github.com/sassoftware/saspy Author: Tom Weber Author-email: @.*** License: UNKNOWN Location: c:\users\pmuhuri\anaconda3\new folder\lib\site-packages Requires: Required-by: SAS-kernel

Name: SAS-kernel Version: 2.4.13 Summary: A SAS kernel for Jupyter Home-page: https://github.com/sassoftware/sas_kernel Author: Jared Dean Author-email: @.*** License: Apache Software License Location: c:\users\pmuhuri\anaconda3\new folder\lib\site-packages Requires: jupyter-client, ipython, metakernel, saspy Required-by:

On Wed, Jan 25, 2023 at 9:30 AM Tom Weber @.***> wrote:

Yes, that is where they are installed. Did you update them to the current versions? Does the SAS_kernel now prompt correctly so you can use it like you want?

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1403711275, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFSCS5ZX6Y3MMNFSDULWUE2IRANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

pkmedu commented 1 year ago

Unfortunately, the following code, which worked before updating saspy and sas_kernel, now gives me errors. Results from print(cfg) are also appended below.

import saspy sas = saspy.SASsession()

import saspy fd = open(saspy.SAScfg) cfg = fd.read() fd.close() print(cfg)

Please enter the name of the SAS Config you wish to run. Available Configs are: ['oda', 'winlocal'] oda

We failed in getConnection The application could not log on to the server "odaws04-usw2.oda.sas.com:8591". No server is available at that port on that machine.

SAS process has terminated unexpectedly. RC from wait was: 4294967290 SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file.

Attempted to run program C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe with the following parameters:['C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe', '-classpath', 'C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\saspyiom.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\iomclient\log4j-1.2-api-2.12.4.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\iomclient\log4j-api-2.12.4.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\iomclient\log4j-core-2.12.4.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\iomclient\sas.security.sspi.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\iomclient\sas.core.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\iomclient\sas.svc.connection.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\iomclient\sas.rutil.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\iomclient\sas.rutil.nls.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\iomclient\sastpj.rutil.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\thirdparty\glassfish-corba-internal-api.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\thirdparty\glassfish-corba-omgapi.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\thirdparty\glassfish-corba-orb.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\thirdparty\pfl-basic.jar;C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\java\thirdparty\pfl-tf.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '52027', '-stdoutport', '52028', '-stderrport', '52029', '-iomhost', 'odaws01-usw2.oda.sas.com;odaws02-usw2.oda.sas.com;odaws03-usw2.oda.sas.com;odaws04-usw2.oda.sas.com', '-iomport', '8591', '-user', @.***', '-lrecl', '1048576', '']

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

SAS_config_names=['oda', 'winlocal'] oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe', #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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' } winlocal = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe', } default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' } # build out a local classpath variable to use below for Windows clients CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\Users\pmuhuri\anaconda3\New folder\Lib\site-packages\saspy\java\saspyiom.jar" winlocal = {'java' : 'java', 'encoding' : 'windows-1252', 'classpath' : cpW }

import saspy fd = open(saspy.SAScfg) cfg = fd.read() fd.close() print(cfg)

SAS_config_names=['oda', 'winlocal']

oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }

winlocal = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe', }

default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }

build out a local classpath variable to use below for Windows

clients CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\Users\pmuhuri\anaconda3\New folder\Lib\site-packages\saspy\java\saspyiom.jar"

winlocal = {'java' : 'java', 'encoding' : 'windows-1252', 'classpath' : cpW }

On Wed, Jan 25, 2023 at 6:12 PM Pradip Muhuri @.***> wrote:

Hello Tom,

I have updated them. Please see below.

Name: saspy Version: 4.5.0 Summary: A Python interface to SAS Home-page: https://github.com/sassoftware/saspy Author: Tom Weber Author-email: @.*** License: UNKNOWN Location: c:\users\pmuhuri\anaconda3\new folder\lib\site-packages Requires: Required-by: SAS-kernel

Name: SAS-kernel Version: 2.4.13 Summary: A SAS kernel for Jupyter Home-page: https://github.com/sassoftware/sas_kernel Author: Jared Dean Author-email: @.*** License: Apache Software License Location: c:\users\pmuhuri\anaconda3\new folder\lib\site-packages Requires: jupyter-client, ipython, metakernel, saspy Required-by:

On Wed, Jan 25, 2023 at 9:30 AM Tom Weber @.***> wrote:

Yes, that is where they are installed. Did you update them to the current versions? Does the SAS_kernel now prompt correctly so you can use it like you want?

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1403711275, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFSCS5ZX6Y3MMNFSDULWUE2IRANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

tomweber-sas commented 1 year ago

That's great that you got the new versions. And you restarted Jupyter and see the SAS_kernel as well as Python kernel still?

But why are you using the bad config file? That's what we fixed yesterday to get things to work: https://github.com/sassoftware/saspy/issues/518#issuecomment-1402644864 https://github.com/sassoftware/saspy/issues/518#issuecomment-1402645842

pkmedu commented 1 year ago

Hello Tom.

This config file seems to be a good one! Please see the results from print(cfg) at the end.

Summary: The oda config works, but the winlocal config gives errors even after using the latest versions of SASPy and sas_kernel.

  1. The issue with winlocal:

proc print data=sashelp.class; run;

Please enter the name of the SAS Config you wish to run. Available Configs are: ['oda', 'winlocal'] winlocal

[<class 'saspy.sasexceptions.SASIOConnectionError'>, SASIOConnectionError('No SAS process attached. SAS process has terminated unexpectedly.'), <traceback object at 0x000001B616C1CF00>]

Any thoughts about resolution?

  1. No issue with oda:

import saspy saspy saspy.list_configs() saspy.SAScfg sas = saspy.SASsession(cfgname='oda') sas

SAS Connection established. Subprocess id is 16000

[6]:

Access Method = IOM SAS Config name = oda SAS Config file = C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\sascfg_personal.py WORK Path = /saswork/SAS_work7D0C000087CF_odaws04-usw2.oda.sas.com/SAS_workF083000087CF_odaws04-usw2.oda.sas.com/ SAS Version = 9.04.01M7P08062020 SASPy Version = 4.5.0 Teach me SAS = False Batch = False Results = Pandas SAS Session Encoding = utf-8 Python Encoding value = utf-8 SAS process Pid value = 34767

[7]:

1

sas.sascfg.SAScfg.SAS_confi

import saspy fd = open(saspy.SAScfg) cfg = fd.read() fd.close() print(cfg)

SAS_config_names=['oda', 'winlocal']

oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }

default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }

build out a local classpath variable to use below for Windows

clients CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\Users\pmuhuri\anaconda3\New folder\Lib\site-packages\saspy\java\saspyiom.jar"

winlocal = {'java' : 'java', 'encoding' : 'windows-1252', 'classpath' : cpW }

Thanks for your continued support,

On Wed, Jan 25, 2023 at 8:06 PM Tom Weber @.***> wrote:

That's great that you got the new versions. And you restarted Jupyter and see the SAS_kernel as well as Python kernel still?

But why are you using the bad config file? That's what we fixed yesterday to get things to work: #518 (comment) https://github.com/sassoftware/saspy/issues/518#issuecomment-1402644864 #518 (comment) https://github.com/sassoftware/saspy/issues/518#issuecomment-1402645842

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1404435182, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFVCPLDCEFPHTOXALUDWUHEZVANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

pkmedu commented 1 year ago

Good morning Tom,

This config file has worked for me. Please see my revisions in bold fonts. Do you have any comments? Please feel free to close it as appropriate. Thank you so much for your patience and guidance!

import saspy fd = open(saspy.SAScfg) cfg = fd.read() fd.close() print(cfg)

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

oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }

default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }

build out a local classpath variable to use below for Windows

clients CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\Users\pmuhuri\anaconda3\New folder\Lib\site-packages\saspy\java\saspyiom.jar"

winlocal = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe', 'encoding' : 'windows-1252', 'classpath' : cpW }

On Wed, Jan 25, 2023 at 11:09 PM Pradip Muhuri @.***> wrote:

Hello Tom.

This config file seems to be a good one! Please see the results from print(cfg) at the end.

Summary: The oda config works, but the winlocal config gives errors even after using the latest versions of SASPy and sas_kernel.

  1. The issue with winlocal:

proc print data=sashelp.class; run;

Please enter the name of the SAS Config you wish to run. Available Configs are: ['oda', 'winlocal'] winlocal

[<class 'saspy.sasexceptions.SASIOConnectionError'>, SASIOConnectionError('No SAS process attached. SAS process has terminated unexpectedly.'), <traceback object at 0x000001B616C1CF00>]

Any thoughts about resolution?

  1. No issue with oda:

import saspy saspy saspy.list_configs() saspy.SAScfg sas = saspy.SASsession(cfgname='oda') sas

SAS Connection established. Subprocess id is 16000

[6]:

Access Method = IOM SAS Config name = oda SAS Config file = C:\Users\pmuhuri\Anaconda3\New folder\lib\site-packages\saspy\sascfg_personal.py WORK Path = /saswork/SAS_work7D0C000087CF_odaws04-usw2.oda.sas.com/SAS_workF083000087CF_odaws04-usw2.oda.sas.com/ SAS Version = 9.04.01M7P08062020 SASPy Version = 4.5.0 Teach me SAS = False Batch = False Results = Pandas SAS Session Encoding = utf-8 Python Encoding value = utf-8 SAS process Pid value = 34767

[7]:

1

sas.sascfg.SAScfg.SAS_confi

import saspy fd = open(saspy.SAScfg) cfg = fd.read() fd.close() print(cfg)

SAS_config_names=['oda', 'winlocal']

oda = {'java' : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',

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'], 'iomport' : 8591, 'authkey' : 'oda', 'encoding' : 'utf-8' }

default = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }

build out a local classpath variable to use below for Windows clients CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION

cpW = "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.svc.connection.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\log4j.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.security.sspi.jar" cpW += ";C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz94582prtxxsp01\deploywiz\sas.core.jar" cpW += ";C:\Users\pmuhuri\anaconda3\New folder\Lib\site-packages\saspy\java\saspyiom.jar"

winlocal = {'java' : 'java', 'encoding' : 'windows-1252', 'classpath' : cpW }

Thanks for your continued support,

On Wed, Jan 25, 2023 at 8:06 PM Tom Weber @.***> wrote:

That's great that you got the new versions. And you restarted Jupyter and see the SAS_kernel as well as Python kernel still?

But why are you using the bad config file? That's what we fixed yesterday to get things to work: #518 (comment) https://github.com/sassoftware/saspy/issues/518#issuecomment-1402644864 #518 (comment) https://github.com/sassoftware/saspy/issues/518#issuecomment-1402645842

— Reply to this email directly, view it on GitHub https://github.com/sassoftware/saspy/issues/518#issuecomment-1404435182, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXDQFVCPLDCEFPHTOXALUDWUHEZVANCNFSM6AAAAAAUDGJFFE . You are receiving this because you authored the thread.Message ID: @.***>

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***

-- Pradip K. Muhuri 2824 Big Bear Terrace Silver Spring, MD 20906 USA c: 301-728-0290 h: 301-438-0301 email: @.***