Learning SAS? Welcome to the exclusive online community for all SAS learners.

data keeps disappearing

Reply
New Contributor
Posts: 4

data keeps disappearing

Hello, all,

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.

Sincerely,

Nancy FH

SAS Employee
Posts: 30

Re: data keeps disappearing

Posted in reply to forsterholt

Hi Nancy,

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.

Marie

New Contributor
Posts: 4

Re: data keeps disappearing

Thank you! How do I save these files?

Nancy

SAS Employee
Posts: 30

Re: data keeps disappearing

Posted in reply to forsterholt

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.

New Contributor
Posts: 4

Re: data keeps disappearing

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!

Super User
Posts: 11,343

Re: data keeps disappearing

Posted in reply to forsterholt

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.

      Data Project.myfirstdata;

          set sashelp.class;

     run;

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.

New Contributor
Posts: 4

Re: data keeps disappearing

Thank you so much; I will try this as soon as I can.

NFH

Ask a Question
Discussion stats
  • 6 replies
  • 911 views
  • 0 likes
  • 3 in conversation