SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

Append to Microsoft Access database

Reply
Occasional Contributor
Posts: 16

Append to Microsoft Access database

How do I append to an access database? Do I need all variables in my SAS data set or I can append to the Access table with just some of them?

I tried this, but SAS didn't like my syntax.

proc sql noprint;
connect to odbc (dsn="CBR Tracker");
execute(insert * from to_tracking into Tbl_entry1) by odbc;
disconnect from odbc;
quit;

Thanks!
Super Contributor
Posts: 291

Re: Append to Microsoft Access database

Don't know if this is the most efficient method, but it works.

1. Import the existing mdb into SAS
2. Append the new data to the SAS dataset
3. Export the new SAS dataset to mdb

PROC IMPORT OUT= WORK.NewOrdFaults
DATATABLE= "NewOrderFaults"
DBMS=ACCESS REPLACE;
DATABASE="\\Moftp\MainFrameFtp\NewOrderFaults.MDB";
SCANMEMO=YES;
USEDATE=YES;
SCANTIME=NO;
RUN;

data UpDater;
set NewOrdFaults
CatalogWk2;
format Delivery DeliveryWk Generate GenerateWk date9.;
run;

PROC EXPORT DATA= WORK.UpDater
OUTTABLE= "NewOrderFaults"
DBMS=ACCESS REPLACE;
DATABASE="\\MOFtp\MainFrameFtp\NewOrderFaults.MDB";
RUN;
Post a Question
Discussion Stats
  • 1 reply
  • 526 views
  • 0 likes
  • 2 in conversation