Architecting, installing and maintaining your SAS environment

Clear oracle library at end of the sas session

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

Clear oracle library at end of the sas session

I created a oracle library to use as "work" in sas guide, where the users can create "work" tables directly in oracle. In our cenary the dimensions and facts are in oracle enviroment and this approach otimises the querys. I searching for a way to delete this "oracle work tables" after the end of the sas session.


Accepted Solutions
Solution
2 weeks ago
Community Manager
Posts: 3,017

Re: Clear oracle library at end of the sas session

Posted in reply to paulkaefer

Paul, there isn't a hook for individual users to set. But an admin can set a Termination Program in the Workspace definition. See this topic in the admin guide.

View solution in original post


All Replies
Regular Contributor
Posts: 180

Re: Clear oracle library at end of the sas session

You can easily clear all datasets from a library (source):

 

 

proc datasets library=lib kill;
run;
quit;

 

I'm not sure if there's an equivalent to the autoexec but at the end, rather than beginning, of a SAS session. This could be a good opportunity to educate the users on the difference between work and permanent libraries, but I agree that it would be nice to have this functionality.

 

I submitted a comment to @ChrisHemedinger on his related blog article. If there's not a way to have an autoexec on session close, I'd say we should submit it as a SASware Ballot Idea.

 

Solution
2 weeks ago
Community Manager
Posts: 3,017

Re: Clear oracle library at end of the sas session

Posted in reply to paulkaefer

Paul, there isn't a hook for individual users to set. But an admin can set a Termination Program in the Workspace definition. See this topic in the admin guide.

New Contributor
Posts: 4

Re: Clear oracle library at end of the sas session

Posted in reply to ChrisHemedinger

Thanks for the reference @ChrisHemedinger, it's exactly this feature I was looking for, I'm new to SAS administration, so I was unaware of this configuration.

New Contributor
Posts: 4

Re: Clear oracle library at end of the sas session

Posted in reply to paulkaefer

Thanks for the answer. @paulkaefer, this is exactly the code I'm going to use. In the future I intend to switch to an Oracle stored process.

Community Manager
Posts: 3,017

Re: Clear oracle library at end of the sas session

My answer assumes that you're running this in a SAS workspace via EG or SAS Studio.  If running with interactive SAS on Windows, there is the TERMSTMT option.  This does not work on Workspace/Stored Process servers.

New Contributor
Posts: 4

Re: Clear oracle library at end of the sas session

Posted in reply to ChrisHemedinger

We have SAS Enterprise BI, but we only use SAS Data Integration (sas batch server), SAS Enterprise Guide and SAS Web Report Studio. Our BI is in low demand, our users are mainly using SAS Guide to perform analyzes directly in our Oracle database (90% of our data is in Oracle).
Our users love SAS Guide.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 179 views
  • 10 likes
  • 3 in conversation