Prev: 2 bars in proc gbarline
Next: logistics model.
From: adjgiulio on 21 Oct 2009 17:51 Hi, Im using a libname statement to connect to a Netezza server through SAS. LIBNAME ntz oledb init_string="Provider=nzoledb; User ID=myuserid;Password=mypassword; Initial Catalog=mycatalog;Data Source=mysource;" schema=myschema; Whats bothering me is that the statement seems to require my userid and password, which obviously I dont feel comfortable leaving in my code and I wouldnt want to delete and retype every time. That was not the case for SQL. LIBNAME sqlsrv oledb init_string="Provider=sqloledb; Integrated Security=SSPI;Persist Security Info=True; Initial Catalog=mycatalog;Data Source=mysource" schema=myschema; Is there any way I can have SAS pull my Windows credentials instead of having to type id and password in the libname statement? Thanks, G
From: Norm Weston on 21 Oct 2009 19:15 What you probably want is an Access Control Template. You can find out more information in PC SAS help files if you look up "Access Control Template" or ACT. Or, if you want to enter ID and password without changing code and you are using Unix with Xwindows or PC SAS, try this; data _null_; retain ID PWD; format ID PWD $15.; ID=''; PWD=''; window get_input irow=2 rows=25 columns=80 #2 @3 'Please confirm the following parameter:' #4 @3 'ID:' +1 ID $15. attr=underline autoskip=yes color=brown persist=yes required=yes #6 @3 'PASSWORD:' +1 PWD $15. attr=underline autoskip=yes color=brown persist=yes required=yes ; window confirm_input irow=20 rows=10 columns=60 #3 @3 'Please Confirm Inputs(Y/N)?' +1 answer $1. attr=underline color=blue required=yes ; window msg_window irow=10 rows=10 columns=80 #4 @3 'Error : ' +1 msg $70. color=blue protect=yes; display get_input; display confirm_input; if upcase(answer) = 'Y' then do; msg=''; if _cmd_ ne ' ' then do; msg='CAUTION: UNRECOGNIZED COMMAND' || _cmd_; answer=''; end; if msg='' then do; ID = UPCASE(ID); PWD = UPCASE(PWD); call symput("myuserid",compress(ID)); call symput("mypassword",compress(ID)); if upcase(answer)='Y' then stop; end; else display msg_window; end; ctr + 1; run; LIBNAME ntz oledb init_string="Provider=nzoledb; User ID=&myuserid;Password=&mypassword; Initial Catalog=mycatalog;Data Source=mysource;" schema=myschema; That should give you a popup window that requests your ID and password and passes them off as macro_variables. Good luck.
From: Michael Raithel on 22 Oct 2009 08:12 Dear SAS-L-ers, Adjgiulio posted the following: > I'm using a libname statement to connect to a Netezza server through > SAS. > > LIBNAME ntz oledb init_string="Provider=nzoledb; > User ID=myuserid;Password=mypassword; > Initial Catalog=mycatalog;Data Source=mysource;" schema=myschema; > > What's bothering me is that the statement seems to require my userid > and password, which obviously I don't feel comfortable leaving in my > code and I wouldn't want to delete and retype every time. > That was not the case for SQL. > > LIBNAME sqlsrv oledb init_string="Provider=sqloledb; > Integrated Security=SSPI;Persist Security Info=True; > Initial Catalog=mycatalog;Data Source=mysource" schema=myschema; > > Is there any way I can have SAS pull my Windows credentials instead of > having to type id and password in the libname statement? > Adjgiulio, up-front; before you get your hopes up; I need to tell you that I cannot help you with the answer to the specific question that you posed in your last paragraph. I have enough trouble with my own credentials, let alone Windows credentials! What I can do is offer another possible source should the casting of your net upon the SAS-L waters not yield any answer-fish that are keepers. I attended a great presentation at SAS Global Forum 2009 that was authored by Paul Sherman and Art Carpenter (though Paul gave the presentation) titled: Secret Sequel: Keeping Your Password Away From the LOG http://support.sas.com/resources/papers/proceedings09/013-2009.pdf Perhaps one or more of the methods that they use in that paper will help. They have the password information in the SQL query itself; which may or may not work for you. And, they have a very clever way of using a "SELECT Libname" that, again may or may not work for you. Whatever the case, it is food for thought! Adjgiulio, best of luck in all of your SAS endeavors! I hope that this suggestion proves helpful now, and in the future! Of course, all of these opinions and insights are my own, and do not reflect those of my organization or my associates. All SAS code and/or methodologies specified in this posting are for illustrative purposes only and no warranty is stated or implied as to their accuracy or applicability. People deciding to use information in this posting do so at their own risk. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Michael A. Raithel "The man who wrote the book on performance" E-mail: MichaelRaithel(a)westat.com Author: Tuning SAS Applications in the MVS Environment Author: Tuning SAS Applications in the OS/390 and z/OS Environments, Second Edition http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=58172 Author: The Complete Guide to SAS Indexes http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=60409 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Acting is all about honesty. If you can fake that, you've got it made. - George Burns +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
From: "Data _null_;" on 22 Oct 2009 08:25 What's wrong with PROC PWENCODE. Seems like using PWENCODE would be the simple solution to the problem. Run it once to encode the PW and then use the encoded version in the LIBNAME of the program(s) that access the the DB. 23 proc pwencode in='adjmost'; 24 run; {sas001}YWRqbW9zdA== On 10/22/09, Michael Raithel <michaelraithel(a)westat.com> wrote: > Dear SAS-L-ers, > > Adjgiulio posted the following: > > > I'm using a libname statement to connect to a Netezza server through > > SAS. > > > > LIBNAME ntz oledb init_string="Provider=nzoledb; > > User ID=myuserid;Password=mypassword; > > Initial Catalog=mycatalog;Data Source=mysource;" schema=myschema; > > > > What's bothering me is that the statement seems to require my userid > > and password, which obviously I don't feel comfortable leaving in my > > code and I wouldn't want to delete and retype every time. > > That was not the case for SQL. > > > > LIBNAME sqlsrv oledb init_string="Provider=sqloledb; > > Integrated Security=SSPI;Persist Security Info=True; > > Initial Catalog=mycatalog;Data Source=mysource" schema=myschema; > > > > Is there any way I can have SAS pull my Windows credentials instead of > > having to type id and password in the libname statement? > > > Adjgiulio, up-front; before you get your hopes up; I need to tell you that I cannot help you with the answer to the specific question that you posed in your last paragraph. I have enough trouble with my own credentials, let alone Windows credentials! > > What I can do is offer another possible source should the casting of your net upon the SAS-L waters not yield any answer-fish that are keepers. > > I attended a great presentation at SAS Global Forum 2009 that was authored by Paul Sherman and Art Carpenter (though Paul gave the presentation) titled: > > Secret Sequel: Keeping Your Password Away From the LOG > http://support.sas.com/resources/papers/proceedings09/013-2009.pdf > > Perhaps one or more of the methods that they use in that paper will help. They have the password information in the SQL query itself; which may or may not work for you. And, they have a very clever way of using a "SELECT Libname" that, again may or may not work for you. Whatever the case, it is food for thought! > > Adjgiulio, best of luck in all of your SAS endeavors! > > > I hope that this suggestion proves helpful now, and in the future! > > Of course, all of these opinions and insights are my own, and do not reflect those of my organization or my associates. All SAS code and/or methodologies specified in this posting are for illustrative purposes only and no warranty is stated or implied as to their accuracy or applicability. People deciding to use information in this posting do so at their own risk. > > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > Michael A. Raithel > "The man who wrote the book on performance" > E-mail: MichaelRaithel(a)westat.com > > Author: Tuning SAS Applications in the MVS Environment > > Author: Tuning SAS Applications in the OS/390 and z/OS Environments, Second Edition > http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=58172 > > Author: The Complete Guide to SAS Indexes > http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=60409 > > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > Acting is all about honesty. If you can fake that, you've > got it made. - George Burns > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >
From: adjgiulio on 22 Oct 2009 12:31 Thank you all for the great ideas! I'll explore all solutions and I'm sure I'll come up with something good! Thanks, G
|
Pages: 1 Prev: 2 bars in proc gbarline Next: logistics model. |