Are you looking for a specific CAS action to use in your project? Maybe you need to create a linear or logistic regression and can't seem to find the CAS action? In this post in the **Getting Started with Python Integration to SAS® Viya®** series, we are going to look at exploring and loading CAS action sets.

In this example, I have already made my connection to CAS using SAS Viya for Learners, and my connection object is named **conn**. Visit Part 1 of the series to learn more about making a connection to CAS.

## Exploring CAS Action Sets

To explore CAS action sets you can use the actionSetInfo CAS action. This should look familiar from Part 2 - Working with CAS Actions and CASResults Objects.

conn.actionsetinfo()['setinfo'] |

The results show the default CAS action sets loaded with SAS Viya. However, many more are available. To see all available CAS action sets use the parameter **all= True**. The results from running the command with the

**all=**parameter includes both

*True***loaded**and

**available**action sets.

conn.actionsetinfo(all=True)['setinfo'] |

As a result of the **all= True** parameter, we can see over a hundred available CAS action sets. The next question is, how do I load an action set?

## Loading a CAS Action Set

I think of loading an action set like importing a package in Python. To load an action set you need to complete two tasks:

- Find the action set
- Load the action set

### Find the action set

First, let's find the action set. Let's assume we need to complete a logistic regression but are unsure of where the necessary CAS action is located. Instead of of manually scrolling through the CASResults object from the **actionSetInfo** CAS action, we can instead search the SASDataFrame (summarized data from CAS) for keywords.

First, I'll set the SASDataFrame from the CASResults object equal to the variable **df** by calling the** setinfo** key.

df = conn.actionsetinfo(all=True)['setinfo'] |

Next, I'll use the **loc** method on the SASDataFrame to search for any action set that contains the string *regression*. There are a variety of ways to do this; I'll use the string **contains** method. I'll make the search case insensitive by using **case= False**.

df.loc[df['actionset'].str.contains('regression', case=False), :] |

Great! In the results I see a **regression** CAS action set. That looks exactly like what I need. Next, it's time to load the action set.

### Load the action set

To load the action use the loadActionSet action with the **actionSet=' regression'** parameter.

conn.loadActionSet(actionSet='regression') |

That's it! You have now loaded a CAS action set! Finally, let's explore the actions inside the **regression** CAS action set.

## Exploring CAS Actions in a CAS Action Set

Once a CAS action set is loaded, you can explore the available CAS actions by using the **help **action with the parameter **actionSet=' regression'**.

conn.help(actionSet='regression') |

The results display a list of all the CAS actions in the **regression **action set. I see the **logistic** CAS action that I need!

## Summary

In conclusion, exploring and loading CAS action sets is important when working on your projects in SAS Viya. A couple of key points to remember:

- The
**actionSetInfo**CAS action returns allCAS action sets.**loaded** - The
**actionSetInfo**parameter**all=True**returnsCAS action sets.**all available** - The
**loadActionSet**CAS actiona CAS action set.**loads**

In the next post we will talk about exploring data stored in the CAS environment in** Exploring Caslibs**.

If you enjoyed this blog post, share it with a friend!

**Additional Information and Resources**

SAS® Viya® 3.5 Actions and Action Sets by Name and Product

Getting Started with Python Integration to SAS® Viya® Index

Getting Started with Python Integration to SAS® Viya® - Part 3 - Loading a CAS Action Set was published on SAS Users.