I am having problems connecting to an Oracle database vis my SAS program in order to execute a Select. I looked at the log (which I attached the snippet below), and it appears for some reason the letters "XX" are being substituted for the numbers "72" in the first two positions of the pasword on the connection. I know that these login credentials work because I can log into that database using those very same credentials through a SQL tool (Quest SQL Navigator). Why is it doing that ? Why is SAS subtituting the first two positions. Does it have to do with Password length ? That's beyond my control as it's set by a DB Admin.
Thanks.
30 proc sql noprint;
31 connect to oracle (path='testdb' user=sysadmin_read_user password=XXb9PCPtS5CCCx2H3jUGCdCZt);
ERROR: Invalid option name b9PCPtS5CCCx2H3jUGCdCZt.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
32 create table PDTABLE as
33 select * from connection to oracle
34 (
35 select b.DEPTID AS "PSTTN",
36 b.ZG_FEDEX_ID AS "DRIVER1",
37 b.ZG_WRK_AREA_ID AS "PDPSA1",
38 TO_CHAR(b.ZG_ON_DUTY_DT,'yyyymmdd') AS "DATE1"
39 from SYSADM.PS_ZG_SAF750_TBL b
40 where b.ZG_ON_DUTY_DT = &YESTERDAY1
41 );
NOTE: Statement not executed due to NOEXEC option.
42 disconnect from oracle;
NOTE: Statement not executed due to NOEXEC option.
43 quit;
Fleroo
I might have to do with the length, I am not sure, I generally put quotes around userid and password.
Please mark the discussion as answered, so others can see immediately that this has been answered
Enjoy using SAS
I should probably add..... I CAN connect to a different Oracle database in the very same program. Of course the Userid: and Password: are different.
try putting the password in quotes.
Hi:
Can you try putting the password in a macro variable?
%let orapwd=mybiglongpassword;
Then use:
proc sql noprint;
connect to oracle (path='testdb' user=sysadmin_read_user password="&orapwd");
I suspect that the problem is caused by SAS trying to mask the password so it is not visible in the log. There may be an option to suppress this as well.
Flreoo
Put the password in quotes like password='XXb9PCPtS5CCCx2H3jUGCdCZt'
WOOHOO... the single quotes worked. BUT, I'm puzzled as to why I didn't need the quotes on the password for the other database I'm connecting to. That password is .... password=oct24. Could it be the length of the password ? Hmmm, oh well, it works. THANK YOU ALL SO MUCH
Fleroo
I might have to do with the length, I am not sure, I generally put quotes around userid and password.
Please mark the discussion as answered, so others can see immediately that this has been answered
Enjoy using SAS
I got an email from Administrations stating I have not set a "status update" and they are asking that I do. What does that mean ? How do I go about doing it ?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.