?>Array ( [lang] => fr [id] => 20 )
Scénario de test & Cas d'usage
Création d'un jeu d'actions 'financeLib' contenant plusieurs actions avec des logiques distinctes. La bibliothèque est ensuite sauvegardée dans la table 'financeLibTable'.
| 1 | PROC CAS; |
| 2 | BUILTINS.defineActionSet |
| 3 | name='financeLib', |
| 4 | actions={ |
| 5 | { |
| 6 | name='calcVolatility', |
| 7 | parms={ {name='prices', type='doublelist'} }, |
| 8 | script='print("Volatility calculated...")' |
| 9 | }, |
| 10 | { |
| 11 | name='calcBlackScholes', |
| 12 | parms={ {name='S', type='double'}, {name='K', type='double'} }, |
| 13 | script='print("Black-Scholes calculated...")' |
| 14 | }, |
| 15 | { |
| 16 | name='calcVaR', |
| 17 | parms={ {name='portfolioValue', type='double'} }, |
| 18 | script='print("Value at Risk calculated...")' |
| 19 | } |
| 20 | }; |
| 21 | |
| 22 | BUILTINS.actionSetToTable |
| 23 | name='financeLib', |
| 24 | TABLE={name='financeLibTable', caslib='CASUSER', replace=true}; |
| 25 | QUIT; |
| 1 | PROC CAS; |
| 2 | BUILTINS.actionSetFromTable |
| 3 | name='qfinLib' |
| 4 | TABLE={caslib='CASUSER', name='financeLibTable'}; |
| 5 | RUN; |
| 1 | BUILTINS.actionSetInfo actionSet='qfinLib'; |
| 2 | RUN; |
| 1 | qfinLib.calcBlackScholes S=100 K=105; |
| 2 | RUN; |
| 3 | QUIT; |
L'action 'actionSetInfo' doit lister le jeu d'actions 'qfinLib' avec ses trois actions ('calcVolatility', 'calcBlackScholes', 'calcVaR'). L'appel à 'calcBlackScholes' doit s'exécuter sans erreur et afficher son message dans le log, validant la restauration d'un jeu d'actions multi-actions.