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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1072 views
  • 2 likes
  • 3 in conversation