08-12-2015 07:31 PM
I keep losing my data files that are automatically going to the 'work' library. When I logout and log back in, the files under the 'work' library will be gone. And I am back at square one. Any suggestions or insights are greatly appreciated.
08-13-2015 10:13 AM
The Work library is a temporary location that only exists for the current SAS session. To have files persist between sessions, you need to save them to a different library.
08-13-2015 11:03 AM
Could you provide a little more information about what you are doing? For example, what SAS product are you using? SAS Studio? SAS University Edition? What code are you trying to run? Most SAS procedures have an option that you can use to specify where to save your output. I just need a little more detail.
08-13-2015 11:24 AM
Great questions. I am using university edition. I have data in mydata library, and am 'keeping' and 'renaming' some variables into a subset of data that is defaulting to the WORK location. I think I just answered my own question. if I add library=mydata to my proc dataset command, it seems to me that this should work? Any thoughts are much appreciated!
08-13-2015 11:23 AM
The basic approach is permanent library. Basic steps are:
1) create a directory or folder where your SAS system has read and write privileges. With the University Edition that would be another folder subordinate to the existing Myfolders. (hint: use a meaningful name for related project items).
2) Associate a library with the location. Generally a LIBNAME statement: LIBNAME Project "the path to the folder goes here"; There may be a wizard or menu that will help you do that, I don't use UE so am not sure.
3) Use the library name in association with your data files any time you want to use a dataset in that library.
4) make sure the library is available the next time you start SAS. The wizard or menu item may have a check box for something like "enable at startup" so that every time you start SAS it knows to make that library useable.
You can have lots of libraries so do not be afraid to have project, or even subproject, specific libraries. For some of my work I have separate libraries for survey sample management and another for the survey data and for each iteration of the survey.
I hope this helps somewhat.