session actionstatus

Edge Case: Querying a Non-Existent or Terminated Session

Scénario de test & Cas d'usage

Business Context

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 was already terminated. The administrator needs to gracefully handle attempts to query invalid sessions without crashing their own diagnostic script.
About the Set : session

Management of the CAS session state.

Discover all actions of session
Data Preparation

No data preparation is needed for this scenario, as it focuses on session metadata and error handling.

Copied!
1/* No data setup is required for this action. */

Étapes de réalisation

1
Attempt to get the status for a hardcoded, syntactically correct, but non-existent UUID.
Copied!
1PROC CAS;
2 string invalid_uuid = 'a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890';
3 PRINT 'Attempting to check status for a non-existent UUID: ' || invalid_uuid;
4 ACTION SESSION.actionstatus / uuid=invalid_uuid;
5RUN;
2
Create a new session, capture its UUID, and then immediately terminate it.
Copied!
1PROC CAS;
2 SESSION casauto name='TempSessionForTermination';
3 ACTION SESSION.listSessions RESULT=r;
4 string terminated_uuid;
5 DO row over r.SESSION;
6 IF row['Session Name'] == 'TempSessionForTermination' THEN
7 terminated_uuid = row['Session UUID'];
8 END;
9 PRINT 'Captured UUID for session to be terminated: ' || terminated_uuid;
10 SESSION TempSessionForTermination terminate;
11 PRINT 'Session terminated.';
12RUN;
3
Attempt to check the status of the now-terminated session using its captured UUID.
Copied!
1PROC CAS;
2 /* Assumes terminated_uuid is populated from the previous step */
3 PRINT 'Attempting to check status for the terminated UUID: ' || terminated_uuid;
4 ACTION SESSION.actionstatus / uuid=terminated_uuid;
5RUN;

Expected Result


Both step 1 and step 3 are expected to fail gracefully. The CAS log should show an error message indicating that the session specified by the UUID could not be found. The key result is that the PROC CAS step does not abort and the client session remains active, demonstrating the action's robustness against invalid input.