Date: Sat, 23 Feb 2008 17:54:29 -0600
Reply-To: "A. Michielsen" <amichielsen@COMCAST.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "A. Michielsen" <amichielsen@COMCAST.NET>
Organization: Your Company
Subject: Re: SAS and Passwords for Oracle Connects
[posted and mailed]
I don't have it in front of me, but if you really want to
make it part of the .bat file you can use another command
line option when starting SAS. Check you SAS Windows Environment
book. I think it's -PARMVALUE You can only have one of those
and the value becomes a MACRO value in your SAS Environment.
So, you need to turn your entire connect string into a macro
substitute. So you bat would look something like:
start/w D:\SASv8\sas.exe -sysin "C:\Documents and Settings\smythc
\Desktop\prog.sas" -parmvalue 'USER="usid" PASSWORD="pwvalue"
Then in your program the use like looks like:
CONNECT TO ORACLE (&parmvalue.);
While I've done this - and if you need some additional help -
you can email me at email@example.com, and I can look for
exact code samples to send to you for the input parm.
However, I recommend creating a macro, or stored macro, or even
a stored code segment that you reference either from the macro
library - or using a %include. With the %include - you can add
all of the options to disable macro quoting and printing to keep
it from repeating in your job log.
firstname.lastname@example.org wrote in news:e54164b1-0745-4f6c-b802-
> Hi all,
> I have a SAS program that runs via a *.bat file, the problem is that
> the SAS program connects to a Oracle database and needs a username and
> password, i dont want to put these into the code of the SAS program,
> nor do i want SAS to prompt me for these.
> What I want is to have &userid and &pw in SAS, these values should be
> stored in the *.bat file.
> My bat file code is
> start/w D:\SASv8\sas.exe -sysin "C:\Documents and Settings\smythc
> my connect code in SAS is:
> /* CONNECT TO THE DATABASE AND EXTRACT THE RAW TABLES */
> PROC SQL;
> CONNECT TO ORACLE (USER="&user" PASSWORD="&PW" PATH="Server01");
> CREATE TABLE RAW.QUESTALL AS
> (SELECT * FROM CONNECTION TO ORACLE
> (SELECT * FROM mystudy.demog));
> Is this possible, seems like it would be hope you can help.