LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: sas-l@uga.edu

[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" PATH="Server01"'

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 amichielsen@regence.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.

colm.smyth@gmail.com wrote in news:e54164b1-0745-4f6c-b802- c3931c2f7eaa@n58g2000hsf.googlegroups.com:

> 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 > \Desktop\prog.sas" > > 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)); > QUIT; > > Is this possible, seems like it would be hope you can help.


Back to: Top of message | Previous page | Main SAS-L page