Are you just getting started with SAS Viya 4 and looking to build models?
As someone new to the world of SAS, running python code outside of Model Studio helped me gain a better understanding of the underlying SAS architecture.
In this article we are running the notebook within Azure Machine Learning Workspace and are connected to a typical SAS Viya 4 instance. Check out this GitHub page for the Notebook used in this example.
The first step is to import the official SAS Viya 4 Python Library: SWAT
Next, we will need to generate an authentication code to be used in downstream processes.
https://myviya4instance.com/SASLogon/oauth/authorize?client_id=SWAT&response_type=code
After you authenticate, we are ready to create a connection to SAS Viya 4
Next, we will load an Action Set
Now that we have established a connection and loaded our Action Set, let's interact with a dataset
From here, you are off to the races! A minimalist example is below.
Congrats - you have successfully run a python version of a SAS Viya 4 model!
Check out the official SWAT API Reference for additional details and examples.
Do you have feedback or are looking for more examples? Get in touch with us by commenting below!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.