Hello,
I'm trying to repair a damaged dataset using the Repair statement but I'm not getting it.
The dataset was damaged because my computer crashed while i was inserting data to de dataset and now at reading the dataset it says:
The thing is this is the exact that Repair Statement is made for (https://www.bing.com/search?q=sas+repair+statement&qs=n&form=QBRE&sp=-1&pq=sas+repair+statme&sc=0-17...).
But I'm not fiding any example code on how to use it and I don't know what I'm doing wrong to repair the dataset.
My code is:
proc datasets; repair schema_name.table_name; run;
Runing this I get this error which I don't know how to avoid it.
Any help with this?
@Seyllia wrote:
My code is:
proc datasets; repair schema_name.table_name; run;
It's been a while since I've done this, but try this:
proc datasets lib=pa_fraud;
repair fr006_log_tests;
quit;
Jim
PROC DATASET differ a little bit from other procedures - you specify the libref on the PROC DATASETS statement.
And then refer to the data set name only (without libref) in the REAPAIR statement.
@Seyllia wrote:
My code is:
proc datasets; repair schema_name.table_name; run;
It's been a while since I've done this, but try this:
proc datasets lib=pa_fraud;
repair fr006_log_tests;
quit;
Jim
Thank you! It seems to work like that but the dataset still won't open...
Do you have any other idea?
@Seyllia wrote:
Thank you! It seems to work like that but the dataset still won't open...
Do you have any other idea?
1) Restart from a backed-up version of the data set.
2) Depending on the type of crash you may have some data in the old work library.
You could run this code:
proc options option=work; run;
Which will show where your current work library is. It may look something like:
WORK=C:\Users\Owner\AppData\Local\Temp\SAS Temporary Files\_TD5300_DESKTOP-C36D7SF_
Find the location of the SAS Temporary Files and look for an older folder and see if there are data sets there.
You may want to assign a library to that old location and my recover temporary data from there.
Didn't work either.
Apart from the actual datasets, i have the .sas7bdat files which I'm not sure what they are. Any way of repairing the dataset from there?
If not, I also found this option DLDMGACTION=FAIL here SAS File Management: Repairing Damaged SAS Files, which might work? How would I use it?
The .sas7bdat files are SAS datasets.
Can't you restore your dataset from a backup, or recreate it through code?
If both of these options are not there (which means you are just learning an object lesson about the importance of backups, the hard way), try to get SAS Technical Support involved. They may have more advanced means to retrieve hopelessly damaged datasets.
BTW, what is the file size of your .sas7bdat file of the damaged dataset?
The file size 22 Gb and I have the code to recompute it but it will take a long time.
Anyway is the option I'm finally taking, thanks for your help!
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.