Solved

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

Posted on 2014-02-24
3
356 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

914 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now