Hi, I am migrating a 9.4 stored process application to JES Web Application on Viya 3.5.
Previously we made use of stp sessions (_SESSIONID:Stored Process Server:Specifies a unique identifier for the session. The _SESSIONID variable is created only if a session), where we explicitly create a session at startup and then used the _sessionid in our urls to ensure the user reuses and runs within the same session. This made would also check for existing query results tables to avoid researching/rerunning queries as the user flips between screens/tabs (i.e. we would look for table cus12345, if it exists then we would display and not rerun the query). When sessions were created we used the save library (created for you when the session was created) to store the tables.
So now in JES Web Application, we need to so the same.
1. Ensure a session is created (i have used the cas function to create the session which generates the UUID for me)
2. Reuse the session, put the UUID in _IOCASEUUID_ variable similar to use of _sessionid, but this does not work
3. re-use existing session tables (previous save library). I have not found similar so making use of the work folder. Effectively i need to ensure the session data is not trashed so I can reuse.
Please assist.
Hope this makes sense 🙂
Thanks in advance.
Brendan
Hi Brendan - I'm not aware of an equivalent for sessions as they were in SAS 9 (perhaps someone will correct me). In general I would say they are bad practice as it makes services harder to test and has an additional server side cost. Services should, in general, be stateless.
It WOULD be possible for you to use the APIs to spin up a compute session and re-use that state.
Or, you could write your temporary results to a permanent library, and access it again later (for this you'll need some kind of cleanup mechanism)
If you are rebuilding an STP web application onto Viya JES I would highly recommend taking a look at the open source framework we built - it's a serious accelerator to these kinds of projects.
hi, thanks, will check it out.
also found this in terms of re-using sessions :
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.