builtins actionSetFromTable

Development: Loading a New Version of an Action Set as an Alias

Scénario de test & Cas d'usage

Business Context

A data science team is developing a new version of a scoring algorithm. They need to load the new version ('scoringModel_v2') from the same saved table as the original ('scoringModel_v1') to run comparison tests without overwriting the original action set in the session.
About the Set : builtins

Fundamental CAS server system commands.

Discover all actions of builtins
Data Preparation

Define a base scoring action set named 'scoringModel_v1' and save it to a table named 'scoring_model_repo'. This table acts as a repository for the model's definition.

Copied!
1PROC CAS;
2 BUILTINS.defineActionSet /
3 name='scoringModel_v1',
4 actions={
5 {
6 name='predict',
7 definition={
8 parms={{name='input', type='string'}},
9 code='print("Prediction from v1 for: " || input);'
10 }
11 }
12 };
13 RUN;
14 
15 BUILTINS.actionSetToTable /
16 actionSet='scoringModel_v1',
17 TABLE={name='scoring_model_repo', caslib='CASUSER', replace=true};
18 RUN;
19QUIT;

Étapes de réalisation

1
Load the original action set from the repository table, keeping its original name.
Copied!
1PROC CAS;
2 BUILTINS.actionSetFromTable /
3 TABLE={name='scoring_model_repo', caslib='CASUSER'};
4RUN;
2
Load the exact same action set from the same repository table, but use the 'name' parameter to give it a new alias, 'scoringModel_v2', for side-by-side testing.
Copied!
1PROC CAS;
2 BUILTINS.actionSetFromTable /
3 TABLE={name='scoring_model_repo', caslib='CASUSER'},
4 name='scoringModel_v2';
5RUN;
3
Verify that both action sets, 'scoringModel_v1' and 'scoringModel_v2', now exist independently in the CAS session.
Copied!
1PROC CAS;
2 BUILTINS.actionSetInfo / actionSet='scoringModel_v1';
3 BUILTINS.actionSetInfo / actionSet='scoringModel_v2';
4RUN;
5QUIT;

Expected Result


Two distinct action sets, 'scoringModel_v1' and 'scoringModel_v2', are present in the session, both loaded from the same source table. This confirms that the 'name' parameter successfully creates a new, aliased instance of the action set, enabling version comparison.