Date: Thu, 25 Feb 2010 19:07:32 -0600
Reply-To: Joe Matise <snoopy369@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Matise <snoopy369@GMAIL.COM>
Subject: Re: create one dataset out of multiple access tables
Content-Type: text/plain; charset=ISO-8859-1
Sure. Is there a consistency of naming in the tables?
In general, assuming you have PC FILES licensed on your (Windows) machine,
you can do :
libname whatever access "file.mdb";
At that point depending on the version of SAS you have and the naming scheme
there are different ways you can proceed.
If the naming scheme is TABLE1 - TABLE100, you can use a variety of DO loops
%do i = 1 %to 100;
set %load_tables; ;
If they're huge, it might be better to use PROC APPEND in a similar fashion.
If they are named inconsistently, you can use PROC SQL to get into the
contents of the access table, something similar to:
select cats('whatever.',memname) into :tables separated by ' '
or similar with proc append.
If you have 9.2 you can also use the : operator ('starts with') if they are
all named something starting with the same letters:
And a few dozen more options :)
On Thu, Feb 25, 2010 at 4:25 PM, Sdlentertd <email@example.com> wrote:
> I have an Access Database with 100 tables with exact same fields, only
> values are different. I need to create one big SAS dataset out of
> those 100 tables.
> is there a way to do it without 200 lines of repetitive code?
> Thank you