BookmarkSubscribeRSS Feed
Niugg2010
Obsidian | Level 7

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

 

 

12 REPLIES 12
GreggB
Pyrite | Level 9

Did you look in your Work library?

Niugg2010
Obsidian | Level 7

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?

Reeza
Super User

@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?

Niugg2010
Obsidian | Level 7

Yes. I am using windows.

Reeza
Super User

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. 

Niugg2010
Obsidian | Level 7

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

Shmuel
Garnet | Level 18

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.

Niugg2010
Obsidian | Level 7

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

Reeza
Super User

@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.

 

Niugg2010
Obsidian | Level 7

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

SASKiwi
PROC Star

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.

Ksharp
Super User
No. You can't. Find some Recovery Software in Internet, maybe that could get you the table back.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 12 replies
  • 9594 views
  • 0 likes
  • 6 in conversation