?>Array ( [id] => 27 ) Edge Case & Automation: Automated Deployment Validation Script - WeAreCAS
builtins actionSetInfo

Edge Case & Automation: Automated Deployment Validation Script

Scénario de test & Cas d'usage

Business Context

A DevOps team is automating the deployment and validation of a new, custom-developed action set named 'customAnalytics'. The validation script must programmatically check if this specific action set is available on the server after deployment. The script must handle the case where the action set exists but is not yet loaded in the session.
Data Preparation

This scenario simulates the existence of a custom action set. No data table is needed.

Copied!
1/* This scenario assumes a custom action set 'customAnalytics' has been deployed to the server but is not yet loaded in the current session. */

Étapes de réalisation

1
First, check for the 'customAnalytics' action set using the default behavior (only loaded sets). This is expected to fail or not show the action set.
Copied!
1PROC CAS;
2 BUILTINS.actionSetInfo RESULT=r;
3 create TABLE CASUSER.LoadedSets as select * from r.ActionSetInfo where upcase(name) = 'CUSTOMANALYTICS';
4RUN;
5QUIT;
2
Since the action set was not loaded, run the check again with 'all=TRUE' to confirm it is at least available on the server. Filter the result to isolate the target action set.
Copied!
1PROC CAS;
2 BUILTINS.actionSetInfo / all=TRUE RESULT=r_all;
3 create TABLE CASUSER.AvailableSets as select * from r_all.ActionSetInfo where upcase(name) = 'CUSTOMANALYTICS';
4RUN;
5QUIT;
3
Conditionally load the action set if it was found to be available but not loaded, and then run the final verification.
Copied!
1PROC CAS;
2 loadactionset 'customAnalytics';
3 BUILTINS.actionSetInfo RESULT=r_final;
4 PRINT r_final.ActionSetInfo where upcase(name) = 'CUSTOMANALYTICS';
5RUN;
6QUIT;

Expected Result


The first step should yield an empty result. The second step should produce a table ('AvailableSets') with one row for 'customAnalytics', showing it is available but not loaded. The final step should successfully load the action set and the printed output should show 'customAnalytics' as loaded. This validates the deployment and the script's logic.