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.
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.
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.
This helps.
Added the statement ->
CONOPTS ='client_session_keep_alive=True' in the libname snowflake connection and issue is resolved.
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.
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!
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.
Ready to level-up your skills? Choose your own adventure.