Scénario de test & Cas d'usage
Creation of a sample customer transaction table. The junior analyst will run a summary on this table.
| 1 | /* This data step is for context; the lead will not run it, but assumes it exists in the analyst's session. */ DATA casuser.transactions_q3; |
| 2 | DO customer_id = 1 to 50000; |
| 3 | DO i = 1 to rannor(123)*5 + 10; |
| 4 | transaction_date = '15JUL2025'd + ranuni(123)*90; |
| 5 | transaction_amount = round(ranuni(123)*1500, 0.01); |
| 6 | OUTPUT; |
| 7 | END; |
| 8 | END; |
| 9 | FORMAT transaction_date date9.; |
| 10 | RUN; |
| 1 | PROC CAS; |
| 2 | SESSION casauto name='AnalystJobSession'; |
| 3 | cas AnalystJobSession; |
| 4 | /* Assume casuser.transactions_q3 table is loaded */ |
| 5 | ACTION SIMPLE.summary / TABLE={name='transactions_q3', caslib='casuser'}, async='summaryJob'; |
| 6 | RUN; |
| 1 | PROC CAS; |
| 2 | SESSION; /* Ensure we are in the lead's session */ |
| 3 | ACTION SESSION.listSessions RESULT=r; |
| 4 | string targetSessionId; |
| 5 | DO row over r.SESSION; |
| 6 | IF row['Session Name'] == 'AnalystJobSession' THEN |
| 7 | targetSessionId = row['Session UUID']; |
| 8 | END; |
| 9 | PRINT 'Target Session UUID to monitor: ' || targetSessionId; |
| 10 | RUN; |
| 1 | PROC CAS; |
| 2 | /* Assuming targetSessionId is populated from the previous step */ |
| 3 | ACTION SESSION.actionstatus / uuid=targetSessionId; |
| 4 | RUN; |
| 1 | |
| 2 | PROC CAS; |
| 3 | |
| 4 | SESSION AnalystJobSession terminate; |
| 5 | RUN; |
| 6 |
The output of step 3 should be a table listing the actions for the 'AnalystJobSession'. It will show the 'simple.summary' action with its job name 'summaryJob' and a state of 'Running' or 'Completed', depending on execution time. This validates the ability to monitor a specific, named session.