builtins actionSetFromTable

Standard Reload of a Custom Operations Toolkit

Scénario de test & Cas d'usage

Business Context

An operations team has developed a standard set of utility actions (e.g., for custom logging, data quality checks) and saved it. A new analyst in a different CAS session needs to load this toolkit to perform routine data validation on a new dataset.
About the Set : builtins

Fundamental CAS server system commands.

Discover all actions of builtins
Data Preparation

First, define a custom action set 'opsToolkit' with a 'checkNulls' action. Then, save this action set to a CAS table named 'toolkit_table' in the 'CASUSER' caslib for persistence.

Copied!
1PROC CAS;
2 BUILTINS.defineActionSet /
3 name='opsToolkit',
4 actions={
5 {
6 name='checkNulls',
7 definition={
8 parms={
9 {name='table', type='table', description='Table to check for nulls'}
10 },
11 code='
12 fetch / table=table, to=1, sastypes=false;
13 print("Checking for nulls in TABLE: " || table.name);
14 /* A real implementation would be more complex */
15 print("Check complete.");
16 '
17 }
18 }
19 };
20 RUN;
21 
22 BUILTINS.actionSetToTable /
23 actionSet='opsToolkit',
24 TABLE={name='toolkit_table', caslib='CASUSER', replace=true};
25 RUN;
26QUIT;

Étapes de réalisation

1
In a new session, restore the 'opsToolkit' action set from the persisted table 'toolkit_table'.
Copied!
1PROC CAS;
2 BUILTINS.actionSetFromTable /
3 TABLE={name='toolkit_table', caslib='CASUSER'};
4RUN;
2
Verify that the 'opsToolkit' action set has been successfully loaded into the current session by checking its information.
Copied!
1PROC CAS;
2 BUILTINS.actionSetInfo / actionSet='opsToolkit';
3RUN;
4QUIT;

Expected Result


The 'opsToolkit' action set is successfully restored and becomes active in the new CAS session. The output of `actionSetInfo` should display the details of the 'opsToolkit', including its 'checkNulls' action, confirming it is ready for use.