Architecting, installing and maintaining your SAS environment

Jupyter with SAS 9.4 (not university)

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 93
Accepted Solution

Jupyter with SAS 9.4 (not university)

Hi Everyone, has anyone used Jupyter with SAS 9.4 (NOT University Edition) and has a good document that could walk me through the process?

 

I have Installed Anaconda, Jupyter and the SAS Kernel on my windows 7 computer.  Now I am attempting to run some code in SAS but I keep getting this error:

 

Cannot use STDIO I/O module on Windows. No SASsession established. Choose an IOM SASconfig definition

 

Does this mean that I can't use Jupyter on Windows at all?  Or does it mean that I HAVE to use university edition to use Jupyter?  Or am I not running a SAS session/process or something else that I am missing?

 

Patrick 


Accepted Solutions
Solution
‎05-04-2017 12:53 PM
Frequent Contributor
Posts: 84

Re: Jupyter with SAS 9.4 (not university)

Hi @thomp7050,

I have Jupyter running on SAS 9.4, however my compute server is running on Linux. Smiley Wink

 

So I am going a bit out on a limb here, but my idea is that you may have to modify the sascfg.py file.

When I look at the sasbase.py file it seems this error is thrown when the access method is set to either STDIO or SSH (see around line 230).

 

However, when I look at the sascfg.py file you have several options that you can pick from.

In line 32 the following is indicated:

#SAS_config_names = ['default', 'ssh', 'iomlinux', 'iomwin', 'winlocal', 'winiomlinux', 'winiomwin', 'http']

 

As a default it is set to default (see line 35)

 

My guess is that you would have to opt for something with 'win' in the name. Maybe 'winlocal'?

When you look further down this file you will see the various options that are being used when you change the access method.

For example, when you opt for winlocal the options are indicated from line 136 onwards.

 

It is just a guess but I hope it helps.

Kind regards,

--Resa

View solution in original post


All Replies
Super User
Posts: 17,836

Re: Jupyter with SAS 9.4 (not university)

I think there's a README file on the SAS GitHub page that helps with getting Jupyter working with SAS locally. 

Solution
‎05-04-2017 12:53 PM
Frequent Contributor
Posts: 84

Re: Jupyter with SAS 9.4 (not university)

Hi @thomp7050,

I have Jupyter running on SAS 9.4, however my compute server is running on Linux. Smiley Wink

 

So I am going a bit out on a limb here, but my idea is that you may have to modify the sascfg.py file.

When I look at the sasbase.py file it seems this error is thrown when the access method is set to either STDIO or SSH (see around line 230).

 

However, when I look at the sascfg.py file you have several options that you can pick from.

In line 32 the following is indicated:

#SAS_config_names = ['default', 'ssh', 'iomlinux', 'iomwin', 'winlocal', 'winiomlinux', 'winiomwin', 'http']

 

As a default it is set to default (see line 35)

 

My guess is that you would have to opt for something with 'win' in the name. Maybe 'winlocal'?

When you look further down this file you will see the various options that are being used when you change the access method.

For example, when you opt for winlocal the options are indicated from line 136 onwards.

 

It is just a guess but I hope it helps.

Kind regards,

--Resa

Frequent Contributor
Posts: 93

Re: Jupyter with SAS 9.4 (not university)

Hi Resa, Thanks!  I think I'm getting closer.  Here's the error I'm getting now:

 

Java Error:
java.lang.NoClassDefFoundError: com/sas/services/connection/ConnectionFactoryException
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
	at java.lang.Class.privateGetMethodRecursive(Unknown Source)
	at java.lang.Class.getMethod0(Unknown Source)
	at java.lang.Class.getMethod(Unknown Source)
	at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
	at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sas.services.connection.ConnectionFactoryException
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 7 more
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" 

Subprocess failed to start. Double check you settings in sascfg.py file.

Attempted to run program java with the following parameters:['java', '-classpath', 'C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94472__prt__xx__sp0__1\\deploywiz\\sas.svc.connection.jar;C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94472__prt__xx__sp0__1\\deploywiz\\log4j.jar;C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94472__prt__xx__sp0__1\\deploywiz\\sas.security.sspi.jar;C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94472__prt__xx__sp0__1\\deploywiz\\sas.core.jar;C:\\ProgramData\\Anaconda3\\Lib\\site-packages\\saspy\\java\\saspyiom.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '52898', '-stdoutport', '52899', '-stderrport', '52900', '-zero', '']

If no Java Error above, try running the following command (where saspy is running) manually to see if it's a problem starting Java:
java -classpath "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94472__prt__xx__sp0__1\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94472__prt__xx__sp0__1\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94472__prt__xx__sp0__1\deploywiz\sas.security.sspi.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94472__prt__xx__sp0__1\deploywiz\sas.core.jar;C:\ProgramData\Anaconda3\Lib\site-packages\saspy\java\saspyiom.jar" pyiom.saspy2j -host localhost -stdinport 52898 -stdoutport 52899 -stderrport 52900 -zero  

No SAS process attached. SAS process has terminated unexpectedly.
No SAS process attached. SAS process has terminated unexpectedly.
No SAS process attached. SAS process has terminated unexpectedly.
No SAS process attached. SAS process has terminated unexpectedly.
No SAS process attached. SAS process has terminated unexpectedly.
No SAS process attached. SAS process has terminated unexpectedly. 
Restarting SAS session on your behalf
in shutdown function
Restarting kernel...
Done!
Out[1]:
'No SAS process attached. SAS process has terminated unexpectedly.'

 

Do you know if I have to run a sas process via SAS Deployment manager or some other app?  Are you running it from a server or a localhost?

 

Super User
Posts: 17,836

Re: Jupyter with SAS 9.4 (not university)

Frequent Contributor
Posts: 93

Re: Jupyter with SAS 9.4 (not university)

Yes, thank you.  I have followed the instructions to their extent.  I have managed to install the SAS Kernel.  I believe that it is an issue of configuration, as @Resa had mentioned.  But I have not found documentation with my error.

Super User
Posts: 17,836

Re: Jupyter with SAS 9.4 (not university)

Log an issue in GitHub and maybe the developers will respond Smiley Happy

Frequent Contributor
Posts: 84

Re: Jupyter with SAS 9.4 (not university)

Hi @thomp7050,

I am running it on a (virtual) server with Linux (CentOS 7) as OS.

As far as I know and understand you do not require to run a service to use Jupyter.

My understanding is that it basically starts a SAS session in the same way a batch process is started.

 

I am no Java expert, but my guess is that maybe one of the settings in the classpath is incorrect.

In the sascfg.py file (lines 130-134) several paths are mentioned. Are yours identical to those?

 

--Resa

 

Frequent Contributor
Posts: 93

Re: Jupyter with SAS 9.4 (not university)

Thanks, Resa!  I appreciate your input on this topic.

 

Here is what I had to do to get it to work:

 

  1. Change my sasconfig to "winlocal"
  2. Update the path to the .jar files with my path, which was off by 1-2 characters in a folder name
  3. Add the path to the correct sspiauth.dll file to the system %PATH=

Then it worked!  Much appreciated.

 

Patrick

Frequent Contributor
Posts: 84

Re: Jupyter with SAS 9.4 (not university)

@thomp7050 great that you have it working!

 

I had some fun 'playing with Jupyter' Smiley Very Happy

Also good that you have posted the steps that were needed to get it working.

This will help others that my run into the same issue.

 

Regards,

--Resa

Super User
Posts: 9,681

Re: Jupyter with SAS 9.4 (not university)

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 10 replies
  • 432 views
  • 2 likes
  • 4 in conversation