Open SAS from within Jupyter

228 Views Asked by At

From within Jupyter, can you make a call to open external software, eg SAS? I have SASpy and SAS. Both work fine. But I want to streamline the process of using SASpy. So, instead of manually opening SAS first, is there a way to insert a command that will result in the software opening?

I have no idea how to go about this. I'm a noob with Python.

2

There are 2 best solutions below

0
On BEST ANSWER

With SASPy or the SAS Kernel you're able to run SAS programs from within Jupyter, so I'm unsure of why you'd want to do this. If you want to programmatically open up SAS 9.4, you can open up any executable in Python with subprocess.run().

import subprocess 

To open SAS Enterprise Guide on Windows:

subprocess.run('C:\\SASHome\\SASEnterpriseGuide\\8\\SEGuide.exe')

To open sas.exe on Windows:

subprocess.run('C:\\SASHome\\SASFoundation\\9.4\\sas.exe')
0
On

Stu Prompted me to find the answer. Their mention of SAS Kernel in the response led me to refine my interwebz search. I found this April 18, 2022 site which resolved the issue Getting started using SASPy® and the SAS® kernel for Jupyter Notebook This method was not previously available to my limited Python and Jupyter knowledge nor within the IT security of my organization.