DATA Step, Macro, Functions and more

ERROR: Invalid or non-supported file specified.

Reply
Contributor
Posts: 34

ERROR: Invalid or non-supported file specified.

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.

Super User
Posts: 7,809

Re: ERROR: Invalid or non-supported file specified.

Posted in reply to BharathBandi

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."

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 34

Re: ERROR: Invalid or non-supported file specified.

Posted in reply to KurtBremser

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??

Contributor
Posts: 26

Re: ERROR: Invalid or non-supported file specified.

Posted in reply to BharathBandi

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

Contributor
Posts: 34

Re: ERROR: Invalid or non-supported file specified.

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.

Super User
Posts: 7,809

Re: ERROR: Invalid or non-supported file specified.

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)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 5 replies
  • 714 views
  • 4 likes
  • 3 in conversation