| 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 |
|
| Content-Type: | text/plain |
|---|
Reddy,
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 statement.
LibName yourMdb odbc complete="dsn=your user
dsn;dbq=\\path\filename.mdb" ;
or
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 */
;
Quit ;
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.
Ed
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
mailto:EdHeaton@westat.com http://www.westat.com
-----Original Message-----
From: Reddi [mailto:reddy_sas2000@YAHOO.COM]
Sent: Wednesday, August 21, 2002 5:22 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Access97
Hi,
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.
Thank You
Reddy
|