BookmarkSubscribeRSS Feed
Bill
Quartz | Level 8

I'm looking for a way to append SAS data to an existing ms access file in such a way as to retain the keys that have been set up in the access file.  Proc Export only allows a replace.  Is there another method to write to ms access that will append to the access file?

Thank you!

Bill

4 REPLIES 4
FloydNevseta
Pyrite | Level 9

I've used proc append successfully to add more data to an existing Access table. Here's an example:

* create a new access database;
proc export data=sashelp.class
   table=class
   dbms=access2007 replace;
   database='c:\data\test.accdb';
run;

libname myaccdb 'c:\data\test.accdb';

* append more data to existing table;
proc append base=myaccdb.class data=sashelp.class;
run;

libname myaccdb clear;

Ksharp
Super User

OR do you consider using SQL ?

Bill
Quartz | Level 8

Ksharp, I would try it if I had the sql code to do so.  Are you able to provide an example?

Thanks,

Bill

Ksharp
Super User

Actually it is almost like  SAS_Bigot 's :

libname myaccdb access 'c:\x.mdb';

*append more data to existing table;

proc sql ;

insert into  myaccdb.xx

select * from  class ;

quit;

libname myaccdb clear;

Not tested. not sure whether it can work.

Ksharp

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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