DATA Step, Macro, Functions and more

how can I restore the deleted datasets

Reply
Frequent Contributor
Posts: 90

how can I restore the deleted datasets

If I delected a datasets by methods such as ;

 

proc sql;

drop table1;

quit;

 

or 

 

proc datasets lib=abc;

delet data1;

run;

 

Where can I find the deleted datasets in my computer? Or how can I restore the deleted datasets? 

Thanks

 

 

Super Contributor
Posts: 279

Re: how can I restore the deleted datasets

Posted in reply to Niugg2010

Did you look in your Work library?

Frequent Contributor
Posts: 90

Re: how can I restore the deleted datasets

[ Edited ]

For example:

 

libname a "C:\*************";
data a.abc;
x=a;
y=b;
run;


proc sql;
drop table a.abc;
quit;

 

the datasets a.abc was completely delected from my computer.

 

How can I get a.abc back?

Super User
Posts: 19,851

Re: how can I restore the deleted datasets

Posted in reply to Niugg2010

Niugg2010 wrote:

For example:

 

 

the datasets a.abc was completely delected from my computer.


Yes, that's what DROP does. 

Did you accidentally delete a table you need? I'm not sure what you're trying to do here. 

 

Are are you on Windows or Unix?

Frequent Contributor
Posts: 90

Re: how can I restore the deleted datasets

Yes. I am using windows.

Super User
Posts: 19,851

Re: how can I restore the deleted datasets

Posted in reply to Niugg2010

Depending on timing and your set up this may or may not work. 

 

Navigate to library path in Windows. 

If Windows 7, right click (on folder) and select properties. In properties pane look for the tab previous versions. Click it. WAIT. It takes a few minutes to populate if it's been turned on. Then you can navigate back in time and restore your file. 

 

 

In Windows 10 (I have no experience) ) here are the instructions from MSFT 

https://support.microsoft.com/en-ca/help/17143/windows-10-back-up-your-files

 

Be careful what you delete. 

Frequent Contributor
Posts: 90

Re: how can I restore the deleted datasets

Thanks. I thought afte delet/drop it will move to a temperary fold, like to "recycle bin". 

Trusted Advisor
Posts: 1,580

Re: how can I restore the deleted datasets

Posted in reply to Niugg2010

As much as I know, deleteing a dataset by SAS procedures, deletes it from the disk

without moving the dataset to the trash. Unless you have backed it up,

the only way is to recreate it, assuming you have the inputs and there are no random created variables.

 

I think that even a disk recovery tool will not help, as probably the file will be read by sas as damaged.

Frequent Contributor
Posts: 90

Re: how can I restore the deleted datasets

Thanks. So the safe way is to build a copy in WORK library and then deal with it.

Super User
Posts: 19,851

Re: how can I restore the deleted datasets

Posted in reply to Niugg2010

Niugg2010 wrote:

Thanks. So the safe way is to build a copy in WORK library and then deal with it.


That depends. You haven't actually explained what you're trying to do.

 

Frequent Contributor
Posts: 90

Re: how can I restore the deleted datasets

I built a datasets to check my code. By accident, I deleted that datasets.

Super User
Posts: 3,257

Re: how can I restore the deleted datasets

Posted in reply to Niugg2010

Store the SAS datasets you want to keep on disks that are backed up, for example a network server or file share. That way even if you accidentally delete them you can get them restored from backup - it should be standard policy that these are backed up daily.

Super User
Posts: 10,041

Re: how can I restore the deleted datasets

Posted in reply to Niugg2010
No. You can't. Find some Recovery Software in Internet, maybe that could get you the table back.
Ask a Question
Discussion stats
  • 12 replies
  • 1133 views
  • 0 likes
  • 6 in conversation