Solved

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

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

Expert Comment

by:Geert Gruwez
Comment Utility
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
Comment Utility
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
Comment Utility
This was how I was able to resolve the problem.  It worked for me.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

10 Experts available now in Live!

Get 1:1 Help Now