BookmarkSubscribeRSS Feed
SAS Employee

The shipped version of the includes configuration details for the various connection methods for saspy. These are guidelines and likely your environment will require some modifications.

The latest version of the file can be viewed on GitHub

The documentation has configuration section that walks through the options step by step. If you have feedback or enhancements I welcome your input.


Here are a few common items to check (line 35)

  • SAS_config_names=['default']
    this line is a python list of the available configuration names. If there is only one configuration name then saspy will use that, if there are multiple and not explicitly specified the user will be prompted. A winlocal reference configuration is included in the file, to use it change the above line to this and saspy will automatically attempt to connect to your local PC SAS version. winlocal is just a name that represents a python dictionary 

 or if you're connecting to multiple SAS servers then you might want to have something like this:


SAS_config_names=['winlocal', 'zos', 'viya']


  • To connect using IOM, you will need to have java installed where python (or Jupyter) will be run and several SAS jars that came with your deployment. On PC SAS, that will just be a matter of finding the location on your system (line 145 shows a default path for 9.4m3 install yours will likely be different). If you're connecting to a remote server via IOM then you'll need to copy the jars from one system to another.


  • lock_down. This prevents users from overriding configuration options. For PC SAS this won't really matter, but for a server installation I would set it to True (the default). Here is the inline documentation beginning at line 26
# Based upon the lock_down configuration option below, you may or may not be able to override option
# that are defined already. Any necessary option (like user, pw for IOM or HTTP) that are not defined will be 
# prompted for at run time. To dissallow overrides of as OPTION, when you don't have a value, simply
# specify options=''. This way it's specified so it can't be overridden, even though you don't have any
# specific value you want applied.



Quartz | Level 8

only trying to connect to local pc sas version...


Pyrite | Level 9
@mmyrto, be careful if this is using JBoss, Red Hat Linux and other Unix apps, there may be mention of fprint.d in the SasConfig file -
delete that as it will cause SAS Grid architecture to
e-SAS regards,

Obsidian | Level 7

Robot wink

These comments are for other SAS Programmers who want to run saspy in Anaconda3 in Windows 10 using a local BASE SAS installation. I found the existing documentation and posts confusing, but I think I've managed to navigate it in the end...


Download Anaconda and install using the recommended option

Note...Your computer may have mutiple versions of Python installed and configured various ways.The Anaconda distribution takes care of most of the setup problems by installing all this within an App

Verify the following:
(base) C:\Users\YOURWINDOWSNAME>python --version
Python 3.6.3 :: Anaconda custom (64-bit)

From the Anaconda DOS prompt (It's an app in your Anaconda3 folder): (base) C:\> pip install saspy
That'll install the saspy package. If you want the SAS kernel too, type pip install sas_kernel. Then you will be able to use the SAS kernel in Jupyter (i.e. write SAS code from a Jupyter notebook - cool eh?)


Now that the saspy package is installed, you have to add the directory that contains the file sspiauth.dll to our Path variable. This file is located at ~\SASHome\SASFoundation\9.4\core\sasext

Update your Path in Windows 10...You need to have Admin rights
In Windows 10 > From the Power User Task Menu > click System > Advanced Settings > Environment Variables > Edit a variable labelled "Path". There are already several folders in a list displayed - Add ~\SASHome\SASFoundation\9.4\core\sasext to the list.

As a check, if you open the cmd line in DOS and type c:\>path you will see something like:


Or, Open Base SAS and run the following to find the PATH – The results will be the same
data _null_;
put x;

Now you use IDLE to edit saspy.cfg - It's in C:\Users\YOURWINDOWSNAME\AppData\Local\Continuum\Anaconda3 (somewhere...).
You will need to go to ~\SAS\SASHome\SASDeploymentManager\9.4\products\~ and make updates according to the versions you see. Note that '\\' means '\' when you are setting paths in your Python editor

The saspy.cfg file looks like
…scroll down to the config names below and make some changes


…scroll down to the path files below

# build out a local classpath variable to use below for Windows clients
cpW = "F:\\SAS\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__NUMBER__prt__xx__sp0__1\\deploywiz\\sas.svc.connection.jar"
cpW += ";F:\\SAS\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__NUMBER__prt__xx__sp0__1\\deploywiz\\log4j.jar"
cpW += ";F:\\SAS\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__NUMBER__prt__xx__sp0__1\\deploywiz\\"
cpW += ";F:\\SAS\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__NUMBER__prt__xx__sp0__1\\deploywiz\\sas.core.jar"
cpW += ";C:\\ProgramData\\Anaconda3\\Lib\\site-packages\\saspy\\java\\saspyiom.jar"

…cpW is aliased as winlocal (see below)

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

The following Python code will start a session: sas = saspy.SASsession(cfgname='winlocal')

You can test your installation using
import saspy
import saspy.sascfg
sas = saspy.SASsession(cfgname='winlocal')
cars = sas.sasdata("CARS","SASHELP")

and you should see a SASHELP data set about cars.


 - Bread Crumbs and Circuses for all

Bread Crumbs and Circuses for All
Quartz | Level 8

I still get the java error


Java Error:
Error: Could not find or load main class pyiom.saspy2j

Obsidian | Level 7

I'm not sure...You may try to double-check all the edits, try another PC (if possible), or review the following info...


The link above suggests it's an issue with java finding the class. The post lists the following as possible reasons...

Reasons why Java cannot find the class

When you get the message "Could not find or load main class ...", that means that the first step has failed. The java command was not able to find the class. And indeed, the "..." in the message will be the fully qualified class name that java is looking for.

So why might it be unable to find the class?

Reason #1 - you made a mistake with the classname argument Reason #2 - the application's classpath is incorrectly specified Reason #2a - the wrong directory is on the classpath Reason #2b - the subdirectory path doesn't match the FQN Reason #2c - dependencies missing from the classpath Reason #3 - the class has been declared in the wrong package


If you have an active SAS license, you could also submit a ticket to help troubleshoot. If you have access to IT support in your org, they can probably review your edits and help with the class issue. If I come across a solution I'll post it here. - Good luck!


-Bread Crumbs and Circuses for all

Bread Crumbs and Circuses for All
SAS Employee

You should take a look at the issues that have been reported on SASPy in GitHub:

From the limited information Issue 24 ( or Issue 58 might give you some trouble shooting


If looking through the issues doesn't yield a solution please open a new issue.



Pyrite | Level 9
Did @Myrto open a new issue?
e-SAS regards,

Calcite | Level 5

I am not sure if this will be of help for you:


I was running into the same error that you are, and I saw the path to the "saspyiom.jar" file was wrong. Please double check the path to the "saspyiom.jar" file in your machine.


In fact, double check the paths in this variable are pointing out to the right files in your machine:


cpL = "/opt/sasinside/SASHome/SASDeploymentManager/9.4/products/deploywiz__94400__prt__xx__sp0__1/deploywiz/sas.svc.connection.jar"
cpL += ":/opt/sasinside/SASHome/SASDeploymentManager/9.4/products/deploywiz__94400__prt__xx__sp0__1/deploywiz/log4j.jar"
cpL += ":/opt/sasinside/SASHome/SASDeploymentManager/9.4/products/deploywiz__94400__prt__xx__sp0__1/deploywiz/"
cpL += ":/opt/sasinside/SASHome/SASDeploymentManager/9.4/products/deploywiz__94400__prt__xx__sp0__1/deploywiz/sas.core.jar"
cpL += "PathYourMachine/saspyiom.jar"

Obsidian | Level 7


   FYI - Here is a link to my paper: . It describes the setup using BASE SAS on a PC. Note that it's also possible to connect Jupyter to a Linux server (but it's a little weirder). Use PyCharm or "Eric" IDLE to edit C:\Anaconda\Lib\site-packages\saspy\ The key lines of your file should look like look like those below. Remember you need to copy the jars to your PC and then define the path to the jars so that your PC and server can talk:


How to connect a PC to a Linux server - Here's what I did anyway


SAS_config_names = ['winiomlinux']


# build out a local classpath variable to use below for Windows clients
cpW = "C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94504__prt__xx__sp0__1\\deploywiz\\sas.svc.connection.jar"
cpW += ";C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94504__prt__xx__sp0__1\\deploywiz\\log4j.jar"
cpW += ";C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94504__prt__xx__sp0__1\\deploywiz\\"
cpW += ";C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94504__prt__xx__sp0__1\\deploywiz\\sas.core.jar"
cpW += ";C:\\Anaconda\\Lib\\site-packages\\saspy\\java\\saspyiom.jar"


winiomlinux = {'java': 'java',
'iomhost': 'YOUR DNS HOSTNAME',
'iomport': 8591,
'encoding': 'latin1',
'classpath': cpW

Good Luck Robot Very Happy Enjoy Python - Wink, wink, nudge, nudge, know what I mean, know what I mean



Bread Crumbs and Circuses for All
SAS Employee

One update that might be helpful to people who find this thread is that the options for accessing configuration files (sascfg) have been increased. You can now use the cfgfile= parameter on the SASsession method to use any configuration file visible from where saspy is installed.

Here is the code:

sas = SASsession(cfgfile='/some/path/to/your/config/')

The full documentation section is here:


Pyrite | Level 9
And as a reminder from another thread, fprint.d is for fingerprint reading but if it makes its way into your sas.config file, suffice it to say in the Unix world and with JBoss 5.1 and Red Hat Linux installed, it'll practically equate to the "Death Star" of SAS Platform!
e-SAS regards,

Calcite | Level 5

I am using Windows with Anaconda. And I run into the following error: 

Java Error:
log4j:WARN No appenders could be found for logger (
log4j:WARN Please initialize the log4j system properly. The application could not find a command to launch a SAS Workspace Server.
	at pyiom.saspy2j.main(
Caused by: org.omg.CORBA.NO_IMPLEMENT: The application could not find a command to launch a SAS Workspace Server.  vmcid: 0x0  minor code: 0  completed: No
	... 5 more

We failed in getConnection
The application could not find a command to launch a SAS Workspace Server.
Subprocess failed to start. Double check your settings in file.

Attempted to run program java with the following parameters:['java', '-classpath', 'C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94498__prt__xx__sp0__1\\deploywiz\\sas.svc.connection.jar;C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94498__prt__xx__sp0__1\\deploywiz\\log4j.jar;C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94498__prt__xx__sp0__1\\deploywiz\\;C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94498__prt__xx__sp0__1\\deploywiz\\sas.core.jar;C:\\Users\\dli7617\\AppData\\Local\\Continuum\\anaconda3\\Lib\\site-packages\\saspy\\java\\saspyiom.jar', 'pyiom.saspy2j', '-host', 'localhost', '-stdinport', '64251', '-stdoutport', '64252', '-stderrport', '64253', '-zero', '-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:
java -classpath "C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94498__prt__xx__sp0__1\deploywiz\sas.svc.connection.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94498__prt__xx__sp0__1\deploywiz\log4j.jar;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94498__prt__xx__sp0__1\deploywiz\;C:\Program Files\SASHome\SASDeploymentManager\9.4\products\deploywiz__94498__prt__xx__sp0__1\deploywiz\sas.core.jar;C:\Users\dli7617\AppData\Local\Continuum\anaconda3\Lib\site-packages\saspy\java\saspyiom.jar" pyiom.saspy2j -host localhost -stdinport 64251 -stdoutport 64252 -stderrport 64253 -zero -lrecl 1048576  

No SAS process attached. SAS process has terminated unexpectedly.
KeyError                                  Traceback (most recent call last)
c:\Users\dli7617\Desktop\Desktop\Python\sas\ in 
----> 1 sas = saspy.SASsession(cfgname='winlocal')

~\AppData\Local\Continuum\anaconda3\lib\site-packages\saspy\ in __init__(self, **kwargs)
    479         # validate encoding
--> 480         pyenc = sas_encoding_mapping[self.sascei]
    481         if pyenc is not None:
    482            if self._io.sascfg.encoding != '':

KeyError: 'No SAS process attached. SAS process has terminated unexpectedly.'

My is located in my saspy folder and it looks like this: 

# 'winlocal': running a LOCAL copy of SAS on Windows
# 'lock_down' - True | False. False = Allow runtime overrides of SAS_Config values below
# 'verbose'   - True | False. True = Allow print statements for debug type messages
SAS_config_options = {'lock_down': False,
                      'verbose'  : True
# build out a local classpath variable to use below for Windows clients
cpW  =  "C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94498__prt__xx__sp0__1\\deploywiz\\sas.svc.connection.jar"
cpW += ";C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94498__prt__xx__sp0__1\\deploywiz\\log4j.jar"
cpW += ";C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94498__prt__xx__sp0__1\\deploywiz\\"
cpW += ";C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94498__prt__xx__sp0__1\\deploywiz\\sas.core.jar"
cpW += ";C:\\Users\\dli7617\\AppData\\Local\\Continuum\\anaconda3\\Lib\\site-packages\\saspy\\java\\saspyiom.jar"

winlocal = {'java'      : 'C:\\Program Files\\SASHome\\SASPrivateJavaRuntimeEnvironment\\9.4\\jre\\bin\\java',
            'encoding'  : 'windows-1252',
            'classpath' : cpW

I added sspiauth.dll to my environment variables. Just wondering what more should I add to make it work? 


SAS Employee

Hey, there error is:

The application could not find a command to launch a SAS Workspace Server.

Which can be found in the troubleshooting guide at number 4, here:


See if you can resolve it based upon that. Let me know and I can help you further if you still have any issues!



Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 28 replies
  • 9 in conversation