Hi All,
In a directory C:\MyData, reside about 30 SAS datasets. i would like to export them as tables to one big access database.
any suggestions on how to do this efficiently?
thanks in advance SAS community!
Try using PROC COPY.
libname in 'c:\mydata';
libname out access 'c:\mydata\mydata.accdb';
proc copy in=in out=out;
run;
If you have SAS/ACCESS Interface to PC Files licenced then I suggest you check out PROC EXPORT.
If you don't have this product then you can still export to CSV files then use MS ACCESS to import them.
Search on MS ACCESS and PROC EXPORT on SAS support to check it further.
Try using PROC COPY.
libname in 'c:\mydata';
libname out access 'c:\mydata\mydata.accdb';
proc copy in=in out=out;
run;
Like Tom's:
libname in v9 'c:\mydata';
libname out oracle path=xx user=xx password=xx ;
proc copy in=in out=out;
run;
Thanks everyone for your input. I'm running this on a 64 bit SAS Server running 9.2 so my slightly tweaked code looks like:
libname in 'c:\mydata';
libname out pcfiles server="SASSERVER.xxxxx.com" port=8621 path= 'c:\mydata\mydata.accdb';
proc copy in=in out=out;
run;
for some reason i'm not to get the access engine to load even when i specify it as accesscs. same goes for excel, xls, and excelcs.
Any messages in the log?
331 libname in excelcs 'C:\mydata';
ERROR: The EXCELCS engine cannot be found.
ERROR: Error in the LIBNAME statement.
What are you trying to do?
If you are moving Excel files into Acess then just use Microsoft tools to do that.
If you are having trouble getting SAS on your Server to create a libname for an Access database then check that you have the proper SAS/Access licenses AND that you are running the proper versions of SAS and Access. THere are many threads around about 64 bit SAS not working with 32 bit Microsoft drivers and the reverse.
64 bit SAS does not support Microsoft EXCEL ACCESS engine .
So at 64 bit environment, the only way to make a excel file is to use PCFILE server just like OP did .
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.