BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lancman
Calcite | Level 5

Can someone explain why the default CAS timeout of 60 seconds needs to be increased when starting a session?

 

In Studio 5.2 Snippets there is Create CAS Connection that simply uses

cas;

to start the session with the default timeout of 60 seconds.

There is also New CAS Session that uses a timeout of 30 minutes

cas mySession sessopts=(caslib=casuser timeout=1800 locale="en_US");

I've seen other examples in papers and documentation that sets the timeout to 3600 or much higher but I don't get why this is needed.

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

So the CAS server knows when it can kill orphaned sessions.  That way it can free resources to serve other users/sessions.  If you know your overall process has a long step between calls to CAS session that might take longer to finish than the default time-out then you can set a longer period so that your overall process can use just the one CAS session. 

View solution in original post

2 REPLIES 2
MCoopmans
SAS Employee

I realise this is an older question that is not yet answered, maybe you found the answer in the meantime. Anyway here is what I believe the behaviour of this option is.

 

The meaning of the timeout parameter is the number of seconds after which the CAS session will end itself when there are no connections to it anymore.

I from a preious dicussion that a user was under the impression the timeout had an influence on the invocation process of the CAS session but that is not the case.

You can easily see that and play with the option settings from a SAS Studio screen:

 

This here will work:

 

cas mySession sessopts=(caslib=casuser timeout=5 locale="en_US");

cas mysession disconnect;

data _null_;
 rc= sleep (3,1);
run;

cas mysession reconnect;

and this here will give an error:

 

cas mySession sessopts=(caslib=casuser timeout=5 locale="en_US");

cas mysession disconnect;

data _null_;
 rc= sleep (7,1);
run;

cas mysession reconnect;

here is the error:

ERROR: Request to RECONNECT failed for UUID 702f50ea-e1ae-6e49-a881-bd5c9732051b. Failure occurs when a disconnected CAS session 
       exceeds the timeout value and terminates, when the specified UUID is not correct or designates a session that is already 
       connected, or when authentication fails.

simply because I deliberately disconnected from the CAS session, and that session had no other connections to it then mine. I then made my SAS sleep for a little longer then the timeout session, so by the time I wanted to reconnect to the CAS session it had ended itself.

Hope this clarifies.
Mathias.

 

 

 

 

Tom
Super User Tom
Super User

So the CAS server knows when it can kill orphaned sessions.  That way it can free resources to serve other users/sessions.  If you know your overall process has a long step between calls to CAS session that might take longer to finish than the default time-out then you can set a longer period so that your overall process can use just the one CAS session. 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2184 views
  • 1 like
  • 3 in conversation