The addUserActionSetPath action adds a caslib to the user-defined action set search path. This allows the CAS server to find and load user-defined action sets from a specified caslib, making them available for execution in the current session.
| Parameter | Description |
|---|---|
| caslib | Specifies the caslib to add to the search path for user-defined action sets. |
The following code creates a local directory and a caslib named 'mycaslib' that points to this directory. This setup is necessary to demonstrate adding a path for user-defined action sets, although the action itself does not require data.
| 1 | /* This action does not directly use |
| 2 | data, but requires a caslib. We create one for the examples. */ |
| 3 | LIBNAME mycaslib "/cas/ |
| 4 | data/casuser"; |
| 5 |
This example demonstrates how to add a caslib named 'mycaslib' to the search path for user-defined action sets. This enables the server to locate action sets stored in this caslib.
| 1 | |
| 2 | PROC CAS; |
| 3 | |
| 4 | BUILTINS.addUserActionSetPath / caslib="mycaslib"; |
| 5 | RUN; |
| 6 |
This detailed example shows the complete process: 1) Define a simple user-defined action set. 2) Save it to a file within a caslib's directory. 3) Add that caslib to the search path using 'addUserActionSetPath'. 4) Load and execute an action from the newly available action set.
| 1 | PROC CAS; |
| 2 | /* Step 1: Define a simple action set and save it */ |
| 3 | SOURCE myActions; |
| 4 | ACTION myEcho(string text); |
| 5 | PRINT "Echo: " || text; |
| 6 | endaction; |
| 7 | ENDSOURCE; |
| 8 | BUILTINS.actionSetFromTable / TABLE={name="myActions"} actionSet="myCustomActions"; |
| 9 | |
| 10 | /* Step 2: Add the caslib to the search path */ |
| 11 | BUILTINS.addUserActionSetPath / caslib="mycaslib"; |
| 12 | |
| 13 | /* Step 3: Load and run the custom action */ |
| 14 | BUILTINS.LOADACTIONSET / actionSet="myCustomActions"; |
| 15 | myCustomActions.myEcho / text="Hello from custom action!"; |
| 16 | RUN; |
A data science team maintains a central CAS library ('ds_project_lib') containing custom-built action sets for recurring analyses (e.g., feature engineering, model validation). ...
An enterprise architect needs to provide a user with access to action sets from three different departments: Finance, Marketing, and a core 'common' library. The system must be ...
A junior analyst is writing a setup script to configure their environment but makes some errors, such as referencing a non-existent caslib and adding the same valid path twice. ...