?>Array ( [lang] => en [id] => 37 )
Scénario de test & Cas d'usage
Create a sophisticated, user-defined action set for financial analysis containing multiple actions with different parameters. This simulates a real-world collection of custom tools.
| 1 | PROC CAS; |
| 2 | ACTION BUILTINS.defineActionSet / |
| 3 | name='financeAnalytics' |
| 4 | definition={{ |
| 5 | ACTION='calculateRisk', |
| 6 | parms={{name='clientId', type='int'}, {name='loanAmount', type='double'}}, |
| 7 | code='print("Calculating risk for client " .. _parms_["clientId"]);' |
| 8 | }, { |
| 9 | ACTION='customerSegment', |
| 10 | parms={{name='demographicsTable', type='table'}}, |
| 11 | code='print("Segmenting customers from TABLE " .. _parms_["demographicsTable"].name);' |
| 12 | }}; |
| 13 | RUN; |
| 14 | QUIT; |
| 1 | PROC CAS; |
| 2 | ACTION BUILTINS.actionSetToTable / |
| 3 | actionSet='financeAnalytics' |
| 4 | casOut={name='ANALYTICS_INVENTORY', caslib='casuser'}; |
| 5 | RUN; |
| 6 | QUIT; |
| 1 | PROC CAS; |
| 2 | ACTION TABLE.fetch / |
| 3 | TABLE='ANALYTICS_INVENTORY'; |
| 4 | RUN; |
| 5 | QUIT; |
The action successfully creates the 'ANALYTICS_INVENTORY' table. The subsequent fetch action returns a table with two rows, where each row details one of the actions ('calculateRisk', 'customerSegment') from the 'financeAnalytics' action set, including their respective parameters and definitions.