BookmarkSubscribeRSS Feed
pururshothaman
Fluorite | Level 6

Hi ,

 

We currently have a SAS 9.4 Grid system on a linux machine.

we are trying to use SASPY python module in the local windows machine connecting to the sasgrid.

How can we achieve this.

we have our python3.7 , pandas, saspy modules installed in our local windows machine, also the sascfg.py is modified as follows

 

 

SAS_config_names=['default', 'iomlinux', 'winiomlinux', 'ssh']

SAS_config_options = {'lock_down': False,
'verbose' : True
}

SAS_output_options = {'output' : 'html5'}


default = {'saspath' : '/sascommon/SAS/SASHome/SASFoundation/9.4/bin/sas_u8'
}

ssh = {'saspath' : '/sascommon/SAS/SASHome/SASFoundation/9.4/bin/sas_en',
'ssh' : '/usr/bin/ssh',
'host' : 'sesklsasgrndevxx.emea.xx.net',
'encoding': 'latin1',
'options' : ["-fullstimer"]
}

 

# build out a local classpath variable to use below for Linux clients CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION
cpL = "/sascommon/SAS/SASHome/SASDeploymentManager/9.4/products/deploywiz__94500__prt__xx__sp0__1/deploywiz/sas.svc.connection.jar"
cpL += ":/sascommon/SAS/SASHome/SASDeploymentManager/9.4/products/deploywiz__94500__prt__xx__sp0__1/deploywiz/log4j.jar"
cpL += ":/sascommon/SAS/SASHome/SASDeploymentManager/9.4/products/deploywiz__94500__prt__xx__sp0__1/deploywiz/sas.security.sspi.jar"
cpL += ":/sascommon/SAS/SASHome/SASDeploymentManager/9.4/products/deploywiz__94500__prt__xx__sp0__1/deploywiz/sas.core.jar"
cpL += ":/opt/github/saspy/java/saspyiom.jar"

iomlinux = {'java' : '/usr/bin/java',
'iomhost' : 'sesklsasgrndevxx.emea.xx.net',
'iomport' : 8591,
'encoding' : 'latin1',
'classpath' : cpL
}

iomwin = {'java' : '/usr/bin/java',
'iomhost' : 'windows.iom.host',
'iomport' : 8591,
'encoding' : 'windows-1252',
'classpath' : cpL
}


# 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__94472__prt__xx__sp0__1\\deploywiz\\sas.svc.connection.jar"
cpW += ";C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94472__prt__xx__sp0__1\\deploywiz\\log4j.jar"
cpW += ";C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94472__prt__xx__sp0__1\\deploywiz\\sas.security.sspi.jar"
cpW += ";C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94472__prt__xx__sp0__1\\deploywiz\\sas.core.jar"
cpW += ";C:\\ProgramData\\Anaconda3\\Lib\\site-packages\\saspy\\java\\saspyiom.jar"

# These jars provide CORBA support for Java 10+ which no longer provides CORBA itself. CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION
cpW += ";C:\\ProgramData\\Anaconda3\\Lib\\site-packages\\saspy\\java\\thirdparty\\glassfish-corba-internal-api.jar"
cpW += ";C:\\ProgramData\\Anaconda3\\Lib\\site-packages\\saspy\\java\\thirdparty\\glassfish-corba-omgapi.jar"
cpW += ";C:\\ProgramData\\Anaconda3\\Lib\\site-packages\\saspy\\java\\thirdparty\\glassfish-corba-orb.jar"
cpW += ";C:\\ProgramData\\Anaconda3\\Lib\\site-packages\\saspy\\java\\thirdparty\\pfl-basic.jar"
cpW += ";C:\\ProgramData\\Anaconda3\\Lib\\site-packages\\saspy\\java\\thirdparty\\pfl-tf.jar"

# And, if you've configured IOM to use Encryption, you need these client side jars. CHANGE THE PATHS TO BE CORRECT FOR YOUR INSTALLATION
#cpW += ";C:\\Program Files\\SASHome\\SASVersionedJarRepository\\eclipse\\plugins\\sas.rutil_904300.0.0.20150204190000_v940m3\\sas.rutil.jar"
#cpW += ";C:\\Program Files\\SASHome\\SASVersionedJarRepository\\eclipse\\plugins\\sas.rutil.nls_904300.0.0.20150204190000_v940m3\\sas.rutil.nls.jar"
#cpW += ";C:\\Program Files\\SASHome\\SASVersionedJarRepository\\eclipse\\plugins\\sastpj.rutil_6.1.0.0_SAS_20121211183517\\sastpj.rutil.jar"


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

winiomlinux = {'java' : 'java',
'iomhost' : 'sesklsasgrndev01.emea.astrazeneca.net',
'iomport' : 8591,
'encoding' : 'latin1',
'classpath' : cpW
}

winiomwin = {'java' : 'java',
'iomhost' : 'windows.iom.host',
'iomport' : 8591,
'encoding' : 'windows-1252',
'classpath' : cpW
}

winiomIWA = {'java' : 'java',
'iomhost' : 'windows.iom.host',
'iomport' : 8591,
'encoding' : 'windows-1252',
'classpath' : cpW,
'sspi' : True
}

 

iomcom = {
'iomhost': 'mynode.mycompany.org',
'iomport': 8591,
'class_id': '440196d4-90f0-11d0-9f41-00a024bb830c',
'provider': 'sas.iomprovider',
'encoding': 'windows-1252'}



httpsviya = {'ip' : 'sastpw.rndk8s.openstack.sas.com',
'context' : 'Data Mining compute context',
'authkey' : 'viya_user-pw',
'options' : ["fullstimer", "memsize=1G"]
}

httpviya = {'ip' : 'sastpw.rndk8s.openstack.sas.com',
'ssl' : False, # this will use port 80
'context' : 'Data Mining compute context',
'authkey' : 'viya_user-pw',
'options' : ["fullstimer", "memsize=1G"]
}

 

 

4 REPLIES 4
JosvanderVelden
SAS Super FREQ
All of the documentation (installation, configuration, troubleshooting, et cetera) for SASpy is located at:

https://github.com/sassoftware/saspy

If you have questions, you can open an issue at https://github.com/sassoftware/saspy/issues
JackHamilton
Lapis Lazuli | Level 10

The documentation on how to write a configuration file is a confused jumble.  It took me much longer to figure out that one configuration file than it did to download, install, and configure Anaconda and Jupyter combined.  

 

I don't know if this is optimal, but this works for me running Jupyter under Anaconda in Windows, connecting to a grid server running on Solaris/Unix:

 

SAS_config_names = ['winiomsolaris']


SAS_config_options = {'lock_down': False,
                      'verbose'  : True
                     }

SAS_output_options = {'output' : 'html5'}

# 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__94494__prt__xx__sp0__1\\deploywiz\\sas.svc.connection.jar"
cpW += ";C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94494__prt__xx__sp0__1\\deploywiz\\log4j.jar"
cpW += ";C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94494__prt__xx__sp0__1\\deploywiz\\sas.security.sspi.jar"
cpW += ";C:\\Program Files\\SASHome\\SASDeploymentManager\\9.4\\products\\deploywiz__94494__prt__xx__sp0__1\\deploywiz\\sas.core.jar"
cpW += ";C:\\Users\\c449630\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\saspy\java\\saspyiom.jar"

# And, if you've configured IOM to use Encryption, you need these client side jars.
cpW += ";C:\\Program Files\\SASHome\\SASVersionedJarRepository\\eclipse\\plugins\\sas.rutil_904500.0.0.20170816190000_v940m5\\sas.rutil.jar"
cpW += ";C:\\Program Files\\SASHome\\SASVersionedJarRepository\\eclipse\\plugins\\sas.rutil.nls_904500.0.0.20170816190000_v940m5\\sas.rutil.nls.jar"
cpW += ";C:\\Program Files\\SASHome\\SASVersionedJarRepository\\eclipse\\plugins\\sastpj.rutil_6.1.0.0_SAS_20121211183517\\sastpj.rutil.jar"

winiomsolaris = {'java'   : 'java',
                'iomhost'   : ['sasgrid01.kp.org','sasgrid02.kp.org','sasgrid03.kp.org'],
                'iomport'   : 8591,
                'classpath' : cpW ,
                'encoding'  : 'latin1'
                }

import os
os.environ["PATH"] += ";C:\\Program Files\\SASHome\\SASFoundation\\9.4\\core\\sasext\\sspiauth.dll"
os.environ["PATH"] += ";C:\\Program Files\\SASHome\\SASFoundation\\9.4\\core\\sasext\\"
sastpw
SAS Employee

@JackHamilton thanks for showing your config file, I'm sure that will make it more clear what @pururshothaman should have. Also, sorry the configuration doc isn't as straightforward as maybe it could be. I write much better code than I do doc 🙂

Having 7 different ways to connect to SAS, depending upon if it's local or remote, if you're using a workspace server (and how that's been deployed/configured), or just a simple install of SAS itself, or even if it's SAS in a Viya deployment, is a lot of information to try to provide. And, this has evolved of the past couple years, so I don't disagree that the config section seems a bit complicated. If there's anything specific that would make it better, since you've been through it and were able to configure it, I'm more than happy to try to make it easier to understand.

 

@pururshothaman for connecting to grid, the config file will be similar to what @JackHamilton showed. You would use the IOM access method Remote version. The config doc for that section is in the links provided by @JosvanderVelden. There are other configuration keys in that doc which you may need for your situation; appserver: for instance, if you have multiple workspace servers defined. If your Grid Admins want to route saspy connections to specific LSF queues, that's possible too; see https://sassoftware.github.io/saspy/advanced-topics.html#configuring-grid-option-sets-to-have-saspy-...

 

Opening an issue on github is always a good way to get help on this too. Or you can contact me directly, my email is on there too. I try to search for 'saspy' posts here too, but I have to manually go do that to see that something new has been posted here, so I'll see it eventually, but not immediately.

 

Let me know if you have any trouble and need more help.

 

Thanks,

Tom

AjmalFarzam
SAS Employee

A little late to the party, but I wrote this post some time ago which outlines the process for a basic setup - you might find it useful 🙂 


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 3494 views
  • 6 likes
  • 5 in conversation