Freedom of choice is now more important than ever, especially when you want to get the most out of your data as an AI specialists. Boasting compatibility with 80+ data sources, including widely adopted open data standards and formats such as Parquet and ORC, the possibilities for data access are virtually limitless with SAS Viya. Check out my colleague Cecily’s blog on how easy it is to set up data access with SAS Viya. Databricks is one of these data sources that SAS Viya works well with, as explained in my colleague Jarno’s blog on harnessing the analytical power of Databricks with SAS. Most versions of Python are supported by Databricks, and as Jarno explains in his blog, you can write Python code natively in SAS Studio on SAS Viya as well. We will touch upon how to use Python inside SAS Viya as well as in your favorite Python tool of choice when using SAS Viya.
Figure 1: SAS Viya as the execution hub for SAS and open-source coders.
As the illustration above shows, SAS Viya not only excels in its native language but also:
See below for a deeper dive into these options and discover how to leverage SAS and Python for enhanced analytical prowess.
Use of Python in SAS Viya for Model development and Decision flows
The tools in SAS Viya for model development and building decision flows have explicit support for Python in code nodes where you can write your own Python code directly. The illustration below shows how you can compare a Python gradient boosting model against an R random forest model and a couple of SAS models in Model Studio.
Using Python inside SAS Studio
In SAS Studio, the Data Engineering tool on SAS Viya, there is native support for Python in the editor. In addition, you can choose code nodes with Python code as well as SAS code when building visual data pipelines. You can even create custom transformation steps with python code and share with your colleagues to enhance their productivity.
Figure 3: Writing Python code in a visual data pipeline in SAS Studio.
SAS Notebooks in Visual Studio Code with SAS Extension
Visual Studio Code with SAS Extension supports SAS Notebooks where you can code with SAS blocks and Python blocks, similar to how notebooks work in Jupyter lab and Databricks.
Figure 4: Using SAS Extension in Visual Studio Code with a SAS Notebook – SAS Code and Python.
Access to SAS Viya from Python environments
Any Python environments that have network access to a SAS Viya environment can use specialized Python libraries curated and powered by SAS to provide efficient access to the power of SAS Viya:
Run Python inside the in-memory based parallel analytics engine of SAS Viya
If you want to get even deeper in SAS Viya with your Python code, you can have your Python code executed directly inside the SAS in-memory parallel analytics engine using the in-memory gateway action set, see SAS Help Center: CAS Gateway Details.
Figure 5: Python code running in parallel on the SAS in-memory server.
Summary
SAS Viya offers a rich array of Python integration options, catering to both built-in SAS Viya applications and external Python environments seeking to tap into the formidable capabilities of SAS Viya. This versatility combined with access to most types of data sources available empowers data scientists, analysts, and AI teams with the freedom of choice to seamlessly collaborate across platforms.
Learn more about SAS and Databricks
Expand your SAS and Databricks knowledge further by exploring these blogs by my colleagues, and anticipate our upcoming blogs posted every Wednesday in SAS Communities.
Harness the analytical power of your Databricks platform with SAS
Data everywhere and anyhow! Gain insights from across the clouds with SAS
Elevated efficiency and reduced cost: SAS in the era of Cloud Adoption
SAS and Databricks: Your Practical Guide to Data Access and Analysis
Data to Databricks? No need to recode - get your existing SAS jobs to SAS Viya in the cloud
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.