session endSession

Standard Cleanup After Nightly Batch Processing

Scénario de test & Cas d'usage

Business Context

A marketing department runs an automated nightly batch to score customer leads. Once the scoring is complete and results are exported, the system must explicitly terminate the CAS session to release the license slot and memory resources for the Finance department's morning batch.
About the Set : session

Management of the CAS session state.

Discover all actions of session
Data Preparation

Simulation of a customer leads dataset.

Copied!
1 
2DATA work.marketing_leads;
3DO i=1 to 50;
4customer_id=i;
5score=rand('Uniform');
6OUTPUT;
7END;
8 
9RUN;
10 

Étapes de réalisation

1
Load data and simulate processing (tableInfo check).
Copied!
1PROC CAS;
2 upload path="work.marketing_leads" casout={name="leads", replace=true};
3 TABLE.tableInfo TABLE="leads";
4RUN;
2
Terminate the session explicitly to free resources.
Copied!
1PROC CAS;
2 SESSION.endSession;
3RUN;

Expected Result


The CAS session terminates successfully without errors. The logs indicate the end of the session, ensuring resources are freed for subsequent processes.