BookmarkSubscribeRSS Feed
destankirimhan
Calcite | Level 5

Dear all,

 

I have deleted my SAS datafiles by mistake and I was able to recover them via an application. Now I have the SAS data files back however when I try to open them with SAS, it gives me the error below that it is not a SAS data set and it cannot be opened. I would really appreciate that if you could help me on this issue. Thanks so much.

 

 

Untitled.png

 

 

Kind regards,

 

Destan

7 REPLIES 7
Kurt_Bremser
Super User

What is the size of the file when listed with ls -l (UNIX) or dir (Windows)? How is the filename spelled? The name of a SAS dataset file has to be all lowercase.

destankirimhan
Calcite | Level 5

Thanks for your instant reply. Its name is all_banks. It is 44 KBs and in Windows. It is lowercase in the data folder I save in my computer. but when it is under TMP1 folder in SAS, it becomes All_banks. Capital A I mean. Its extension is .sas7bdat in my folder I save in my computer. But when I open it in SAS, it becomes .DATA. 

Tom
Super User Tom
Super User

@destankirimhan wrote:

Thanks for your instant reply. Its name is all_banks. It is 44 KBs and in Windows. It is lowercase in the data folder I save in my computer. but when it is under TMP1 folder in SAS, it becomes All_banks. Capital A I mean. Its extension is .sas7bdat in my folder I save in my computer. But when I open it in SAS, it becomes .DATA. 


Is SAS running on Windows?  If not than having the physical filename start with uppercase A will not work.

But your error message is more about the content of the file.  When the file is not found it usually gives a different error.

Example:

387   proc print data=work.xyz; run;
ERROR: File WORK.XYZ.DATA does not exist.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

388


389   data _null_;
390     file "%sysfunc(pathname(work))/xyz.sas7bdat";
391     put 'This is NOT a SAS dataset';
392   run;

NOTE: The file ".../xyz.sas7bdat" is:

      Filename=...\xyz.sas7bdat,
      RECFM=V,LRECL=32767,File Size (bytes)=0,
      Last Modified=26Feb2020:14:29:16,
      Create Time=26Feb2020:14:29:16

NOTE: 1 record was written to the file ".../xyz.sas7bdat".
      The minimum record length was 25.
      The maximum record length was 25.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


393
394   proc print data=work.xyz; run;
ERROR: File WORK.XYZ.DATA is not a SAS data set.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
Reeza
Super User
I suspect that's an error from trying to double click and opening the file that way rather than code.

OP try assigning a libname to the location and then using PROC PRINT. Show your full code and log and see what happens.


libname example 'path to where file is located';

proc print data=example.all_banks;
run;
PaigeMiller
Diamond | Level 26

You didn't say what steps in SAS led to this error message. Please be specific and detailed and describe the steps, or show us the exact code.

 

Also, using your operating system, please determine the full name and extension of this file, and let us know. It must end with .sas7bdat for the current versions of SAS to recognize it as a SAS data step.

 

Finally, you don't say how you recovered the file, please explain those details as well. My experience with file recovery software is not all that positive, sometimes it says it has recovered the file but in fact it has not done a good job and all you have is a corrupted and not usable file.

--
Paige Miller
destankirimhan
Calcite | Level 5

Thanks for your instant reply. I posted my answers in my first reply under this topic. I used EaseUS program to recover the SAS datafiles. 

Reeza
Super User

What is the file extension and file name? It's possible the files were not recovered correctly and may be damaged. 

 


@destankirimhan wrote:

Dear all,

 

I have deleted my SAS datafiles by mistake and I was able to recover them via an application. Now I have the SAS data files back however when I try to open them with SAS, it gives me the error below that it is not a SAS data set and it cannot be opened. I would really appreciate that if you could help me on this issue. Thanks so much.

 

 

Untitled.png

 

 

Kind regards,

 

Destan


 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 933 views
  • 0 likes
  • 5 in conversation