|Date: ||Thu, 22 Aug 2002 09:27:18 -0400|
|Reply-To: ||Ed Heaton <EdHeaton@WESTAT.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Ed Heaton <EdHeaton@WESTAT.COM>|
|Subject: ||Re: Access97|
I will make some assumptions and then give a solution based on those
assumptions. Assume you are working on a Windows platform. Assume, also,
that you are running SAS v8.0 or higher. Then...
1. Start by going to the Control Panel through your Start menu. You should
have an icon for ODBC (Mine is called ODBC Data Sources.). Open this.
2. You should have a User DSN that uses an *.mdb driver. I have two; one is
called "MS Access 97 Database" and the other is called "MS Access
Database". I don't know why I have both, they both seem to work. You will
need to make note of the exact wording of this DSN.
3. Now, you can access your data from SAS using either SQL Pass-through or a
LibName yourMdb odbc complete="dsn=your user
Proc sql ;
Connect to odbc as yourMdb (
complete="dsn=your user dsn;dbq=\\path\filename.mdb"
/* Create a SAS data set from a MS Access table. */
Create table YourSasTable as
select /* list of variables or * for all variables */
from connection to yourMdb (
/* MS Access SQL code goes here. You can simply code
select * from YourAccessTable
/* add remaining WHERE, ORDER BY, and GROUP BY statements
that you want to use in SAS SQL rather than Access SQL */
Notes: 1. You use MS Access SQL and SAS SQL. Be sure to use the correct
form in the correct place.
2. Your query will be more efficient if you process as much of the
subsetting as you can with the MS Access SQL.
Edward Heaton, Senior Systems Analyst,
Westat (An Employee-Owned Research Corporation),
1550 Research Boulevard, Room 2018, Rockville, MD 20850-3195
Voice: (301) 610-4818 Fax: (301) 294-3992
From: Reddi [mailto:reddy_sas2000@YAHOO.COM]
Sent: Wednesday, August 21, 2002 5:22 PM
I need to access the MS-Access97 database . I want to access through the
Proc Sql pass through facility. Can any body let me know how to access.