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
Hi @thomp7050,
I have Jupyter running on SAS 9.4, however my compute server is running on Linux.
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
I think there's a README file on the SAS GitHub page that helps with getting Jupyter working with SAS locally.
Hi @thomp7050,
I have Jupyter running on SAS 9.4, however my compute server is running on Linux.
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
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!
'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?
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.
Log an issue in GitHub and maybe the developers will respond 🙂
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
Thanks, Resa! I appreciate your input on this topic.
Here is what I had to do to get it to work:
Then it worked! Much appreciated.
Patrick
@thomp7050 great that you have it working!
I had some fun 'playing with Jupyter'
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
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.