DATA Step, Macro, Functions and more

Import unsuccessful. See SAS log files (Foxpro Data)

Reply
Occasional Contributor
Posts: 18

Import unsuccessful. See SAS log files (Foxpro Data)

Hello everyone,

 

I'm trying to import a particular foxpro database table using the follow

PROC IMPORT OUT=FOXPRO.xxxxxx
DATAFILE="C:\FOXPRO-DBF\xxxx\xxxxxx.DBF"
DBMS=DBFMEMO REPLACE;

 

and it is displaying the error 

ERROR: Import unsuccessful.  See SAS Log for details.

 

What could be the reason and how to fix this? 

I have not faced such an issue in importing any other tables from foxpro or any other database

 

Please help

 

Best regards,

Sanat

 

 

Super User
Posts: 10,568

Re: Import unsuccessful. See SAS log files (Foxpro Data)

"See SAS Log for Details." lets me think there is more in the log of the import step.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Community Manager
Posts: 3,457

Re: Import unsuccessful. See SAS log files (Foxpro Data)

Posted in reply to KurtBremser

Alas @KurtBremser, not necessarily.  I've seen that error myself and details aren't always available.

 

I guess it's better than saying:

 

Import unsuccessful. *shrug*
Occasional Contributor
Posts: 18

Re: Import unsuccessful. See SAS log files (Foxpro Data)

Posted in reply to KurtBremser

@ChrisHemedinger has rightly pointed out. The details are not available.

Super User
Posts: 10,568

Re: Import unsuccessful. See SAS log files (Foxpro Data)


sklal wrote:

@ChrisHemedinger has rightly pointed out. The details are not available.



D**n. Worst case situation. Do you still have FoxPro or some other software with which you can inspect the file?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Occasional Contributor
Posts: 18

Re: Import unsuccessful. See SAS log files (Foxpro Data)

Posted in reply to KurtBremser

Yes, it had just column names inside it. Same was the case with 47 other such files. The client's foxpro team has now  confirmed that these files were all corrupted. So I guess this error shows when the files are corrupted. 

Super User
Posts: 13,926

Re: Import unsuccessful. See SAS log files (Foxpro Data)

Run  this code:

proc setinit; run;

proc product_status;run;

 

See if you have SAS/ACCESS Interface to PC Files in both sections of output.

If not in the first then not licensed, if in the first and not the second then the interface wasn't installed.

 

I think the FoxPro memo files are supposed to have a FPT extension. Perhaps you don't want DBFMEMO but DBMS=DBF.

 

One also never quite knows when a hyphen in a path name causes a problem. You might try renaming the FOXPRO-DBF folder with the "-".

Occasional Contributor
Posts: 18

Re: Import unsuccessful. See SAS log files (Foxpro Data)

Thanks for the response.

 

I don't think there is any licensing issue(I have checked both the statements). Also, I tried replacing dbfmemo with dbf and changed the path name, now it doesn't throw an error but it is not displaying any rows inside the dataset , just blank column names.

 

Is there any formatting issue within the file itself ? Or do I need to make some modifications from my side?

Super User
Posts: 13,926

Re: Import unsuccessful. See SAS log files (Foxpro Data)


sklal wrote:

Thanks for the response.

 

I don't think there is any licensing issue(I have checked both the statements). Also, I tried replacing dbfmemo with dbf and changed the path name, now it doesn't throw an error but it is not displaying any rows inside the dataset , just blank column names.

 

Is there any formatting issue within the file itself ? Or do I need to make some modifications from my side?


What size, how many bytes, does the operating system say that file has. If it is under 10K it might actually be empty with only column header information.

 

I was never much of a FoxPro guru but I seem to remember that some of the databases that use DBF formatted files actually have one or two other files that accompanied them. When other programs looked at that data they expected those other files to be in the same location with the same name except a different extension.

 

If you don't have FoxPro but do have Excel you might try opening it with Excel. This is a longish shot, but if it works then you could save from Excel to a CSV file which may be easier to import. You would be reading a delimited file or DBMS=CSV. Use a large value for the GUESSINGROW (32000 or number of lines in the file, which ever is smaller) option to have best chance of Proc Import reading values correctly.

Occasional Contributor
Posts: 18

Re: Import unsuccessful. See SAS log files (Foxpro Data)

I checked it with Visual foxpro as well as excel and they too were showing just column names inside. Same was the case with 47 other such files. The file(s) size varied between 2KB and 5KB. The client's foxpro team has now confirmed that these files are corrupted. So, it seems this error shows up when the files are corrupted. Not sure if there is any other reason for this error.

Super User
Super User
Posts: 8,274

Re: Import unsuccessful. See SAS log files (Foxpro Data)

Did you check the file to make sure it is actually as DBF or at least a FOXPRO version of a DBF file?

You can get a quick dump of the beginning of the file by using a simple DATA step. For example you could look at the first 800 bytes by running this program.

data _null_;
  infile "C:\FOXPRO-DBF\xxxx\xxxxxx.DBF" recfm=f lrecl=80 obs=10 ;
  input;
  list;
run;

You can find more information on the DBF file format on-line.  Try here.

https://www.loc.gov/preservation/digital/formats/fdd/fdd000325.shtml

 

Occasional Contributor
Posts: 18

Re: Import unsuccessful. See SAS log files (Foxpro Data)

Yes , it is an actual DBF file but I tried opening the file on Visual Foxpro and excel and the just showed column names. It seems this file and 47 other such files are corrupted. So I guess this error shows up when the files are corrupted. 

Ask a Question
Discussion stats
  • 11 replies
  • 271 views
  • 4 likes
  • 5 in conversation