BookmarkSubscribeRSS Feed
BharathBandi
Calcite | Level 5

50   PROC IMPORT OUT=Payroll_45439223

51               DATAFILE="C:\SAS Payroll\45439223.dbf"

52               DBMS=DBF REPLACE;

53      DBENCODING=pcoem850;

54   RUN;

NOTE: Imported 103 columns and 2 rows of data from the dBase table file.

NOTE: WORK.PAYROLL_45439223 data set was successfully created.

NOTE: PROCEDURE IMPORT used (Total process time):

      real time           0.09 seconds

      cpu time            0.00 seconds

55   PROC IMPORT OUT=Payroll_Paytrans

56               DATAFILE="C:\SAS Payroll\Paytrans.dbf"

57               DBMS=DBF REPLACE;

58      DBENCODING=pcoem850;

59   RUN;

ERROR: Invalid or non-supported file specified.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE IMPORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

I'm trying to read dbase files using above code but some of them are giving error. Can anyone help me to solve this.

Thanks in advance.

5 REPLIES 5
Kurt_Bremser
Super User

Take a hex editing tool and have a look at the files in their binary/hexadecimal representation. The file extension often does not reflect the actual contents of the file.

Also take a look at this:

34240 - An error occurs when you try to read Visual FoxPro DBF Files with the IMPORT procedure

Hint: simply searching for the text of a SAS error message in the search engine of your choice will often yield interesting information. The above link is #1 if you simply google "ERROR: Invalid or non-supported file specified."

BharathBandi
Calcite | Level 5

Thank you Kurt. I got Visual FoxPro 32 bit Download Microsoft OLE DB Provider for Visual FoxPro 9.0 from Official Microsoft Download Center  

when I'm trying to connect through SAS OLE DB connection it is not showing in the provider list. How to access a 32 bit in a 64 bit sas??

rcwright
Calcite | Level 5

Hate to state the obvious but have you checked that you've got the correct path and filename - no spaces, for example. Only asking from experience.

Second, might try using the PCFILES access method: LIBNAME lref PCFILES PATH=<>;

Third, try importing from the Import wizard: File<Import Data

BharathBandi
Calcite | Level 5

Yes I have tried both methods. The only way I can read those files is through OLE DB connection but the problem here is visual fox pro has only 32 bit driver while i'm using  64 bit SAS.

Kurt_Bremser
Super User

As with similar problems (Excel!), the most stable option is to export the database file to a common flat file format (.csv or fixed columns) and read that with a data step. The intermediate flat file can be controlled with a simple text editor, abd you don't have to hassle with bitness or encodings (encodings can be manipulated externally)

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
  • 5 replies
  • 2911 views
  • 4 likes
  • 3 in conversation