Solved

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

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

While it may be true that the internet is a place of possibilities, it is also a hostile environment lurking with many dangers. By clicking on the wrong link, trusting the wrong person or using a weak password, you are virtually inviting hackers to …
After-hours service is a fact of life for most MSPs. While not the most pleasant aspect of the job, there are ways to make after-hours servicing a more profitable and organized enterprise.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

685 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