DATA Step, Macro, Functions and more

Accidentally Deleted Dataset?

Reply
Highlighted
New User
Posts: 1

Accidentally Deleted Dataset?

I just opened a SAS dataset stored on my hard drive by double clicking on the file, which opened a temporary dataset in SAS. I then changed my mind and decided I wanted to work directly with the file stored in the folder (i.e: by creating a library for the folder the file lives in). Further, since this is a very large file, I need to be be mindful of duplicate copies (or at least what I thought would be a duplicate copy), so I deleted the temporary file from the "tmp1" folder. 

 

After deleting the file from the tmp1 folder, I went back to the original folder where the files lives on my hard drive and noticed the file was now gone from that location. Does deleting a temporary file in SAS also delete the file from its source location on the hard drive? Why would this happen? Any perspectives on this, or whether the file may still live somewhere on my hard drive, would be appreciated! I did check to see whether it showed up in my recycle bin, and it did not. 

Super User
Posts: 10,280

Re: Accidentally Deleted Dataset?

Posted in reply to MidwestAnalyst

When you double-click on a .sas7bdat, no copy is made. SAS instead defines a temporary library for the directory the file resides in, and opens the dataset from there. A delete therefore removes the file from where it was.

 

Since you couldn't find the file in the Windows trashcan, your only hope is a backup.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Trusted Advisor
Posts: 1,256

Re: Accidentally Deleted Dataset?

Posted in reply to MidwestAnalyst

There are also recovery tools on the market which are able to recover, e.g., files which have been deleted with SHIFT-DEL (i.e. bypassing the Windows recycle bin). I'm not sure, however, if they can help in your case, in particular if you continued using your computer (or restarted it) after deleting the file.

 

On my machine I have changed the default file associations, so that a double-click on a .sas7bdat file (or .sas file) in a Windows Explorer window launches SAS Universal Viewer (SAS.UniViewer.exe), not SAS (sas.exe).

 

Good luck!

Ask a Question
Discussion stats
  • 2 replies
  • 76 views
  • 0 likes
  • 3 in conversation