Mike,
Where exactly do you want this library. Should it reside under the work library path? Do you want it to vanish (erase itself) after the SAS session? Please give us some more details.
I can give you a few ideas. First some background on how SAS creates & uses its temp workspace. On a Windows system (the other OS's may have a slightly dif. way) SAS will read a config file (usually SAS8.cfg in ver 8). In this file there is a path to directory that sas uses for its work directory. This becomes the root of the temp folder. SAS uses a seed to create a temp folder named '#some_number'. It is in this folder that the work library is pointed to. You could get the physical path by using the pathname('work') function. If you want to create a temp work space all you have to do is create a folder any where you want on your system and set a libname statement. At the end of you code you could run a
proc datasets kill lib=your_temp_libname;quit;
libname your_temp_libname; **to unregister the library;
and you have your temp library that acts like the work library.
I hope that this helps you Mike.
Klaz
Mike,
Why not write a small macro that does this job? Name it EndSas and execute it when your finished with your sas jobs (coding)
Here is an example:
In your config file (and every SAS session has one) you could write your setup code. Code that creates a work2 library wherever you choose.
like in you ex.
%sysexec mkdir "%SYSFUNC(PATHNAME(WORK))\tmp2";
libname WORK2 "%SYSFUNC(PATHNAME(WORK))\tmp2";
Then you do what you have to do and when your finished....
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.