0
votes

I am trying to export SAS Dataset to my local in ".mdb" format (Access Database). I am using Proc Export statement but it gives the error "Connection Failed"

Also, When I tried to achieve this using EG "Export" feature (on top of the editor window), I used "Export xyz as a step in Project" , I could not find access format there though excel, txt etc options were available.

I did Proc Setinit and found that SAS/Access interfact to PC Files is installed.

I am using SAS 9.4, SAS EG 7.12 and Access 2013. The code I used is as below -

     proc export data=test 
    dbms= ACCESS
     outfile="M:\SASAnalytics\Test\test1.mdb" 
    replace;
    run;

And When I tried assigning the libname using

    libname mdb "M:\AFolder\BFolder\C.mdb"

I got this error - ERROR: Connect: Class not registered.

I guess, there is nothing with the code but the SAS Access Export is not enabled or something. Please suggest what could be the issue and how to resolve that?

1

1 Answers

0
votes

I assume your SAS installation is 64-bit and MS Office is 32-bit. If that so, you have to use PC Files as proxy server between SAS and Office. dbms=ACCESS is using standard LIBNAME as connection. In your case dbms=ACCESSCS is needed. Moreover for Access file you must specify file location using DATABASE= statment and table name using OUTTABLE= option in proc export. Complete code:

proc export data=sashelp.class 
   dbms= ACCESSCS
   outtable="Class"
   replace;
   database = "C:\Class.mdb";
run;

More Access specific options: Microsoft Access Database Files