?>
The `actionSetToTable` action transforms a user-defined action set, which is a collection of custom operations, into a standard in-memory CAS table. This allows for the inspection, management, and storage of action set definitions using standard table manipulation tools. It is particularly useful for auditing, documenting, or programmatically analyzing custom actions available on the CAS server.
| Parameter | Description |
|---|---|
| actionSet | Specifies the name of the user-defined action set to be converted into a CAS table. This action set must already exist on the server. |
| casOut | Specifies the properties of the output table, such as its name, the caslib where it will be stored, and whether to replace an existing table with the same name. |
Before converting an action set to a table, one must first be defined. This code snippet creates a simple, user-defined action set named `myCustomActions` which includes a single action called `hello`. This action set will serve as the source for the `actionSetToTable` examples.
proc cas; action builtins.defineActionSet / name='myCustomActions' definition={{action='hello', parms={{name='name', type='string'}}, code='print("Hello, " .. _parms_["name"]);'}}; run; quit;This example demonstrates the fundamental use of `actionSetToTable`. It takes the user-defined action set `myCustomActions` and converts its definition into a new CAS table named `actions_definition_table` within the `casuser` caslib.
| 1 | PROC CAS; ACTION BUILTINS.actionSetToTable / actionSet='myCustomActions' casOut={name='actions_definition_table', caslib='casuser'}; RUN; ACTION TABLE.fetch / TABLE='actions_definition_table'; RUN; QUIT; |
In scenarios where you might be updating an action set and need to refresh its corresponding definition table, the `replace=true` option is essential. This example converts the `myCustomActions` action set and ensures that if a table named `actions_definition_table` already exists, it will be overwritten with the new definition.
| 1 | PROC CAS; ACTION BUILTINS.actionSetToTable / actionSet='myCustomActions' casOut={name='actions_definition_table', caslib='casuser', replace=true}; RUN; ACTION TABLE.fetch / TABLE='actions_definition_table'; RUN; QUIT; |
This example demonstrates how to make the resulting table globally accessible to all subsequent CAS sessions by using the `promote=true` option. This is useful when the action set definition needs to be shared or referenced across different user sessions or applications without reloading it each time.
| 1 | PROC CAS; ACTION BUILTINS.actionSetToTable / actionSet='myCustomActions' casOut={name='actions_definition_table', caslib='casuser', promote=true}; RUN; ACTION TABLE.tableInfo / name='actions_definition_table'; RUN; QUIT; |
A financial services company must maintain a queryable inventory of all custom analytical functions deployed on the CAS server. This is required for regulatory compliance and in...
A data science team maintains a 'recommendationEngine' as a CAS action set. This engine is updated frequently. A CI/CD pipeline must be able to redeploy the action set and overw...
A user is attempting to document a custom action set but makes a typo in the name. The system must be robust enough to handle this user error gracefully by reporting that the ac...