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
Did you look in your Work library?
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?
@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?
Yes. I am using windows.
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.
Thanks. I thought afte delet/drop it will move to a temperary fold, like to "recycle bin".
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.
Thanks. So the safe way is to build a copy in WORK library and then deal with it.
@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.
I built a datasets to check my code. By accident, I deleted that 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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.