BeOptimized - Tips and Tricks

Access CAS for Python users

SAS Viya is the latest enhancement of the SAS Platform. Since this release you can, as a Python programmer, access data and procedures available on the SAS Viya platform.
This can be done by inserting Python Nodes in your data flows but this can also be done thanks to the SWAT python package (SAS Scripting Wrapper for Analytics Transfer).
What does that mean? You can do with Python everything you can do in SAS: load/unload data in memory, doing parallel processing, accessing databases data via SAS libraries, working in a secured environment, use remote server. etc.
This tips and tricks is designed for people who know already Python, SQL, Pandas and who would like to access SAS Viya from Python.

Details

In this tips and tricks, we will first make a summary of the most important things discussed in the introduction SAS Viya for SAS users tips and tricks. Then we will dive into SWAT package in order to :

  • Make connection and access CASLIB
  • List objects, load & drop tables in CASLIB
  • Save data into SASHDAT
  • Load data to CASLIB
  • Manipulate data in SAS and get the results in Python and VICE VERSA
  • Query the data with FEDSQL
  • Query the data with data step
  • Display data with CASL
  • Query CAS table like in Pandas with CAS table object
  • Push CAS table to DATAFRAME

What I love in that tips and tricks is that you can really do data manipulation in Python and then push your data to SAS in order to visualize them in SAS Visual Analytics or other analytics modules. Moreover, thanks to CAS server, it is super easy to manipulate huge datasets in memory and parallel processing.

Prerequisites

You have some Python experience and would like to access SAS Viya from Python.


Go back to your selection


This site uses cookies. .

By continuing to browse the site you are agreeing to our use of cookies. Review our cookies information for more details.