session endSession

Edge Case: Syntax Validation with Optional Parameters

Scénario de test & Cas d'usage

Business Context

An IT Admin acts as an orchestrator for multiple analytical jobs. They need to develop a robust wrapper script that terminates sessions but also captures the operation's status code (RC) for audit logging purposes, ensuring the syntax handles the optional parameters correctly before the connection is severed.
About the Set : session

Management of the CAS session state.

Discover all actions of session
Data Preparation

No complex data needed, creating a simple config flag.

Copied!
1DATA work.config; STATUS='ACTIVE'; RUN;

Étapes de réalisation

1
Check Session ID before termination.
Copied!
1PROC CAS;
2 SESSION.sessionId RESULT=r;
3 PRINT "Current Session UUID: " || r.uuid;
4RUN;
2
Terminate session using full syntax with status capture.
Copied!
1PROC CAS;
2 SESSION.endSession STATUS=rc;
3 PRINT "Termination Return Code: " || (string)rc;
4RUN;

Expected Result


The code compiles and executes. The 'status=rc' parameter is accepted validly. The session terminates, and while the print statement might be cut off by the session ending (depending on client behavior), the syntax is proven valid.