BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
samanvi
Obsidian | Level 7

HI Every one,

 

One of my sas code is connecting to snowflake and keep executing  for long time after 4 hrs the session is getting disconnected and sas job is getting failed with error

"ERROR:CLI PREPARE ERROR AUTH TOKEN EXPIRED, uSER MUST AUTH AGAIN"

 

Could you help me how to keep session active.

1 ACCEPTED SOLUTION

Accepted Solutions
SASJedi
SAS Super FREQ

Is your program assigning the Snowflake LIBNAME early in the code, then doing a lot of other stuff that doesn't use Snowflake data? According to this Snowflake forum article, your error message indicates that your Snowflake session has gone more than 4 hours without activity. They Do mention that you could use the CLIENT_SESSION_KEEP_ALIVE option to extend the session timeout. The LIBNAME Statement for Snowflake documentation provides a CONOPTS statement option that can be used to specify additional Snowflake connection options like this one. 

 

Check out my Jedi SAS Tricks for SAS Users

View solution in original post

3 REPLIES 3
SASJedi
SAS Super FREQ

Is your program assigning the Snowflake LIBNAME early in the code, then doing a lot of other stuff that doesn't use Snowflake data? According to this Snowflake forum article, your error message indicates that your Snowflake session has gone more than 4 hours without activity. They Do mention that you could use the CLIENT_SESSION_KEEP_ALIVE option to extend the session timeout. The LIBNAME Statement for Snowflake documentation provides a CONOPTS statement option that can be used to specify additional Snowflake connection options like this one. 

 

Check out my Jedi SAS Tricks for SAS Users
samanvi
Obsidian | Level 7

This helps.

Added the statement -> 

 CONOPTS ='client_session_keep_alive=True' in the  libname snowflake connection and issue is resolved.

 

SASKiwi
PROC Star

I suggest you discuss your issue with your Snowflake DBA to see if there are any timeout settings for database connections. If there is a hard setting in Snowflake then that's the only place it can be changed.

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
  • 3 replies
  • 980 views
  • 2 likes
  • 3 in conversation