In [1]:
!ssh-add adam.pem


Identity added: adam.pem (rsa w/o comment)

In [ ]:
# This will work with new versions of saspy not the current 2.1.6
import os
import sys

this_dir = os.path.dirname(os.path.realpath(__name__))
sys.path.insert(0, this_dir)

In [2]:
import saspy

In [3]:
# sas = saspy.SASsession(cfgname='default')
sas = saspy.SASsession(cfgname='ssh')


SAS Connection established. Subprocess id is 69


In [4]:
c = sas.submit("""proc javainfo; run;""")

In [5]:
c['LOG']


Out[5]:
"\n27   ods listing close;ods html5 (id=saspy_internal) file=stdout options(bitmap_mode='inline') device=svg; ods graphics on /\n27 ! outputfmt=png;\nNOTE: Writing HTML5(SASPY_INTERNAL) Body file: STDOUT\n28   \n29   proc javainfo; run;\nPFS_TEMPLATE = /opt/sas9.4/install/SASHome/SASFoundation/9.4/misc/tkjava/qrpfstpt.xml\njava.class.path = /opt/sas9.4/install/SASHome/SASVersionedJarRepository/eclipse/plugins/sas.launcher.jar\njava.class.version = 51.0\njava.runtime.name = Java(TM) SE Runtime Environment\njava.runtime.version = 1.7.0_76-b13\njava.security.auth.login.config = /opt/sas9.4/install/SASHome/SASFoundation/9.4/misc/tkjava/sas.login.config\njava.security.policy = /opt/sas9.4/install/SASHome/SASFoundation/9.4/misc/tkjava/sas.policy\njava.specification.version = 1.7\njava.system.class.loader = com.sas.app.AppClassLoader\njava.vendor = Oracle Corporation\njava.version = 1.7.0_76\njava.vm.name = Java HotSpot(TM) 64-Bit Server VM\njava.vm.specification.version = 1.7\njava.vm.version = 24.76-b04\nsas.app.class.path = /opt/sas9.4/install/SASHome/SASVersionedJarRepository/eclipse/plugins/tkjava.jar\nsas.ext.config = /opt/sas9.4/install/SASHome/SASFoundation/9.4/misc/tkjava/sas.java.ext.config\ntkj.app.launch.config = /opt/sas9.4/install/SASHome/SASVersionedJarRepository/picklist\nuser.country = US\nuser.language = en\n\nNOTE: PROCEDURE JAVAINFO used (Total process time):\n      real time           1.02 seconds\n      user cpu time       0.01 seconds\n      system cpu time     0.01 seconds\n      memory              20.59k\n      OS Memory           12184.00k\n      Timestamp           09/08/2017 08:00:21 PM\n      Step Count                        2  Switch Count  0\n      Page Faults                       0\n      Page Reclaims                     71\n      Page Swaps                        0\n      Voluntary Context Switches        1426\n      Involuntary Context Switches      0\n      Block Input Operations            0\n      Block Output Operations           0\n      \n30   \n31   ods html5 (id=saspy_internal) close;ods listing;\n\n32   "

In [ ]: