Scénario de test & Cas d'usage
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.
| 1 | PROC 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; |
| 26 | QUIT; |
| 1 | PROC CAS; |
| 2 | BUILTINS.actionSetFromTable / |
| 3 | TABLE={name='toolkit_table', caslib='CASUSER'}; |
| 4 | RUN; |
| 1 | PROC CAS; |
| 2 | BUILTINS.actionSetInfo / actionSet='opsToolkit'; |
| 3 | RUN; |
| 4 | QUIT; |
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.