DATA Step, Macro, Functions and more

how can I restore the deleted datasets

Reply
Contributor
Posts: 66

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: 268

Re: how can I restore the deleted datasets

Did you look in your Work library?

Contributor
Posts: 66

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: 17,771

Re: how can I restore the deleted datasets


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?

Contributor
Posts: 66

Re: how can I restore the deleted datasets

Yes. I am using windows.

Super User
Posts: 17,771

Re: how can I restore the deleted datasets

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. 

Contributor
Posts: 66

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,368

Re: how can I restore the deleted datasets

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.

Contributor
Posts: 66

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: 17,771

Re: how can I restore the deleted datasets


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.

 

Contributor
Posts: 66

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,101

Re: how can I restore the deleted datasets

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: 9,671

Re: how can I restore the deleted datasets

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
  • 667 views
  • 0 likes
  • 6 in conversation