These comments are for other SAS Programmers who want to run saspy in Anaconda3 in Windows 10 using a local BASE SAS installation...

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:

PATH=C:\Oracle\product\11.2.0\client_X64\bin;C:\ProgramData\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;F:\SAS\SASHome\SASFoundation\9.4\ets\sasexe;F:\SAS\SASHome\Secure\ccme4;F:\SAS\SASHome\SASFoundation\9.4\core\sasext;C:\Users\YOURWINDOWSNAME\AppData\Local\Microsoft\WindowsApps;

Or, Open Base SAS and run the following to find the PATH – The results will be the same

data _null_;

x=sysget('PATH');

put x;

run;

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

SAS_config_names=['winlocal','winiomwin','winiomIWA']

…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\\sas.security.sspi.jar"

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")

cars.describe()

and you should see a SASHELP data set about cars.

- Bread Crumbs and Circuses for all

Bread Crumbs and Circuses for All