Help using Base SAS procedures

Connect to Oracle from SAS

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

Connect to Oracle from SAS

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;


Accepted Solutions
Solution
‎07-25-2013 09:39 AM
SAS Super FREQ
Posts: 708

Re: Connect to Oracle from SAS

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

View solution in original post


All Replies
Occasional Contributor
Posts: 14

Re: Connect to Oracle from 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.

Trusted Advisor
Posts: 2,115

Re: Connect to Oracle from SAS

try putting the password in quotes.

Super Contributor
Posts: 358

Re: Connect to Oracle from SAS

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.

SAS Super FREQ
Posts: 708

Re: Connect to Oracle from SAS

Flreoo

Put the password in quotes like password='XXb9PCPtS5CCCx2H3jUGCdCZt'

Occasional Contributor
Posts: 14

Re: Connect to Oracle from SAS

Posted in reply to Bruno_SAS

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

Solution
‎07-25-2013 09:39 AM
SAS Super FREQ
Posts: 708

Re: Connect to Oracle from SAS

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

Occasional Contributor
Posts: 14

Re: Connect to Oracle from SAS

Posted in reply to Bruno_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 ?

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 1062 views
  • 0 likes
  • 4 in conversation