Solved

Passing using name and password as global variable from input file in SAS Enteprise

Posted on 2014-02-24
3
360 Views
Last Modified: 2016-02-10
Experts,

I would like to pass my username and password as a global variable being read in from an Excel spreadsheet so it is not hard-coded in programs.

Can someone tell me how to do this? When hardcoding the variable I use this:

%Let USR = MYNAME;
%Let ORAPW = 'MYNAME#7';

How can I code this so I can read "MYNAME" and "MYNAME#7" from an input file and assign it to the global variable?
0
Comment
Question by:morinia
  • 2
3 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 39884847
what programming language or what database are you referring to

global variables of the os or of the program ?
0
 

Accepted Solution

by:
morinia earned 0 total points
ID: 39885546
I am using SAS.  I was able to use the concatention and build the macro.

This worked for me.  USR and ORAPW were read in from an Excel Spreadsheet using Import. The name of the spreadsheet was myLogin and thus the name of the table created was myLogin with the two fields.  By adding the quotes around the Password which contained a special character "#", the connect to Oracle worked.

CONNECT TO ORACLE AS EDS(user=&USR. pw=&ORAPW PATH='myPath');

Data hold_login;
      Set myLogin(KEEP=USR ORAPW);
      string1 ="'"||ORAPW||"'";
      call symput("USR", USR);
    call symput("ORAPW", string1);
run;
0
 

Author Closing Comment

by:morinia
ID: 39898372
This was how I was able to resolve the problem.  It worked for me.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question