11-06-2015 05:10 AM
I am using SAS 9.2
Location of my default temporary ‘work’ library
C:\Users\user1\AppData\Local\Temp\SAS Temporary Files\_TD6864_UPLCI087142_
But when I run the following code
and then find location of this ‘TEMP’ library using the following command
Question: I am not sure that an automatic libname “temp” exists in SAS. And data stored here are permanent. I could not find this in any SAS documentation. Can you please explain.
11-06-2015 06:53 AM
No, there is no libname called temp in the default SAS install. Work is the temporary folder. The idea is that in your programs - (or if you work on a project or server environment these might be setup for you) - create the references which you use to store you data, work is removed at the end of the session:
libname yourlib "path-to-folder";
So path-to-folder is a folder on your local machine, or network where to store data permanently.
11-06-2015 08:34 AM
Thank you for posting this interesting question. Searching for the answer I discovered this page of the online help (for SAS under Windows):
When you use a libref in a SAS statement, SAS resolves libref assignments in this order:
a libref assigned by a LIBNAME statement, a LIBNAME function, or by using the New Library dialog box, with the last assignment taking precedence
a libref assigned by a SAS environment variable
a libref assigned by a Windows environment variable.
In your case I guess that a Windows environment variable TEMP exists (this is the case on my computer, too) and points to the path you've mentioned.
You can quickly list the Windows environment variables and their values in the SAS log by submitting the following code:
filename ttt pipe 'set'; data _null_; infile ttt lrecl=5000; input; put _infile_; run;
A list of the SAS environment variables (see item 2 above) and their values can be obtained as follows: