Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2014-02-24
Medium Priority
Last Modified: 2016-02-10

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 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?
Question by:morinia
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 38

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 ?

Accepted Solution

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.


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

Author Closing Comment

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

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
On September 18, Experts Exchange launched the first installment of the Help Bell, a new feature for Premium Members, Team Accounts, and Qualified Experts. The Help Bell will serve as an additional tool to help teams increase question visibility.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA:…

705 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