BookmarkSubscribeRSS Feed
Chip
Calcite | Level 5
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!
1 REPLY 1
Bill
Quartz | Level 8
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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Discussion stats
  • 1 reply
  • 1455 views
  • 0 likes
  • 2 in conversation