The `session.actionstatus` action allows you to retrieve the status of actions for a specific CAS session. This is particularly useful for monitoring long-running jobs or for managing multiple sessions concurrently. By providing the unique identifier (UUID) of a session, you can get detailed information about the state of any actions that have been submitted within that session, such as whether they are running, completed, or have failed.
| Parameter | Description |
|---|---|
| uuid | Specifies the unique identifier (UUID) of the session for which you want to retrieve the action status. This is a required parameter. |
The `actionstatus` action operates on session metadata and does not require any specific data to be loaded into CAS. It is used to monitor the status of actions within existing sessions.
| 1 | /* No data setup is required for this action. */ |
This example first retrieves the UUID of the current session using the `sessionId` action and then uses that UUID to get the status of actions within that same session.
| 1 | PROC CAS; |
| 2 | SESSION.sessionId RESULT=r; |
| 3 | string mySessionId = r.SESSION; |
| 4 | SESSION.actionstatus / uuid=mySessionId; |
| 5 | RUN; |
In this scenario, we start a new session ('MyNewSession') and run a potentially long-running action asynchronously (like `simple.summary`). We then use the `actionstatus` action from our original session to monitor the progress of the summary action by referencing the new session's UUID.
| 1 | PROC CAS; |
| 2 | SESSION casauto name='MyNewSession'; |
| 3 | |
| 4 | /* Load some data into the new session */ |
| 5 | cas MyNewSession; |
| 6 | DATA casuser.cars; |
| 7 | SET sashelp.cars; |
| 8 | RUN; |
| 9 | |
| 10 | /* Run a summary action asynchronously in 'MyNewSession' */ |
| 11 | ACTION SIMPLE.summary / TABLE={name='cars', caslib='casuser'}, async='summaryJob'; |
| 12 | |
| 13 | /* Switch back to the original session to monitor */ |
| 14 | SESSION; |
| 15 | |
| 16 | /* Get the UUID of 'MyNewSession' */ |
| 17 | ACTION SESSION.listSessions RESULT=r; |
| 18 | string targetSessionId; |
| 19 | DO row over r.SESSION; |
| 20 | IF row['Session Name'] == 'MyNewSession' THEN |
| 21 | targetSessionId = row['Session UUID']; |
| 22 | END; |
| 23 | |
| 24 | /* Check the status of the job in the other session */ |
| 25 | IF targetSessionId ne '' THEN DO; |
| 26 | PRINT 'Checking status for session: ' || targetSessionId; |
| 27 | ACTION SESSION.actionstatus / uuid=targetSessionId; |
| 28 | END; |
| 29 | ELSE DO; |
| 30 | PRINT 'Session MyNewSession not found.'; |
| 31 | END; |
| 32 | |
| 33 | /* Clean up the other session */ |
| 34 | cas MyNewSession terminate; |
| 35 | RUN; |
A lead data scientist needs to monitor the progress of a critical data aggregation job being run by a junior analyst in a separate, persistent CAS session. The lead needs to con...
An automated nightly process kicks off several model scoring jobs in parallel to score different customer segments. Each job runs in its own CAS session for isolation. A master ...
A system administrator is debugging the CAS environment. They have a list of session UUIDs from a logging system, but one of them may correspond to a session that has crashed or...