Date: Wed, 3 Dec 2003 16:54:11 -0500
Reply-To: "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Subject: Re: DB parm? for CONNECTION TO
Hi, Mark,
I found the following blurbs in sas8 OnlineDoc, under
SAS/ACCESS
Sortware for Relational Databases (SAS/ACCESS)
Part 5 SAS/ACCESS Software: DBMS-Specific Information
ODBC Chapter, First Edition
CNNECT Statement
"
DSN | DS | DATASRC | DATABASE=<'>data-source-name<'>
specifies the ODBC data source to which you want to connect. For PC
platforms, data sources must be configured by using the ODBC icon in the
Windows Control Panel. For UNIX platforms, data sources must be configured
by modifying the .odbc.ini file. DSN= indicates that the connection is
attempted using the ODBC SQLConnect API, which requires a data source
name. Optionally, a user ID and password (described below) can be used in
conjunction with DSN=. This API is guaranteed to be present in all
drivers.
Specify either DSN= or one (and only one) of the following arguments:
PROMPT, NOPROMPT, COMPLETE, or REQUIRED. These arguments are all mutually
exclusive of each other.
"
It seems that database= option is asking dsn, which should be already
defined.
If you are running sas on windows, check out Richard DeVenezia's Web site
for createDSN.sas macro for dynamically creating one at
http://www.devenezia.com/downloads/sas/macros/index.php?m=createDSN
.
Cheers,
Chang
p.s. If you find the macro helpful, please don't forget to tell Richard
that I sent you there :-)
On Wed, 3 Dec 2003 09:09:29 -0800, Terjeson, Mark <TERJEM@DSHS.WA.GOV>
wrote:
>Hi All,
>
>I can't seem to find CONNECTION TO doc that
>tells me if there is a parameter that can be used
>to specify which database you want within a
>Microsoft SQL Server ODBC DSN. I can go into
>the ODBC entries and change the default database
>in the configuration settings manually, but I would
>like to find the syntax to change it on the fly in
>my programs.
>
>example:
>
>if DSN='MySQLSvr5'); gets me to the right
>ODBC entry point such as:
>PROC SQL;
> * Establish connection to SQL Server data;
> CONNECT TO ODBC(DSN='MySQLSvr5');
>
>is there a parameter syntax that will change the
>target database, such as: (by the way, the syntax
>below does not work, but is an example of the sort
>of thing I am after) e.g. DATABASE='Claims');
>
>PROC SQL;
> * Establish connection to SQL Server data;
> CONNECT TO ODBC(DSN='MySQLSvr5' DATABASE='Claims');
>
>?????
>
>
>Hope somebody knows,
>Mark Terjeson
>Reporting, Analysis, and Procurement Section
>Information Services Division
>Department of Social and Health Services
>State of Washington
>mailto:terjem@dshs.wa.gov
|