<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Macro Variable for password in Libname in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/466821#M283159</link>
    <description>I got that error&lt;BR /&gt;&lt;BR /&gt;ERROR: Invalid option name {.</description>
    <pubDate>Fri, 01 Jun 2018 13:09:51 GMT</pubDate>
    <dc:creator>Jamwat</dc:creator>
    <dc:date>2018-06-01T13:09:51Z</dc:date>
    <item>
      <title>Macro Variable for password in Libname</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/445873#M283153</link>
      <description>&lt;P&gt;How do I use a macro variable for my password in a libname statement as in the example below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mypwd = "{SAS002}9A8C3F4E20629B7F34D2C88A5569E5995AE23782";


libname bigdata odbc noprompt="Driver={Amazon Redshift (x86)};
Server=server.domain.edu;
Database=prod; UID=mylogin; PWD=&lt;STRONG&gt;&amp;amp;mypwd&lt;/STRONG&gt;; Port=5439" schema=nyu;
run&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe the fact that the connection info is already inside double quotes is causing the issue.&amp;nbsp; I've confirmed that I have the connection info correct and that it works if I enter the password directly without encoding it and using a variable.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 15:51:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/445873#M283153</guid>
      <dc:creator>tedway</dc:creator>
      <dc:date>2018-03-15T15:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable for password in Libname</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/445876#M283154</link>
      <description>&lt;P&gt;Try adding some more quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname bigdata odbc noprompt="Driver={Amazon Redshift (x86)};
Server=server.domain.edu;
Database=prod; UID=mylogin; PWD="&amp;amp;mypwd"; Port=5439" schema=nyu;
run&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Mar 2018 15:54:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/445876#M283154</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-15T15:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable for password in Libname</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/445881#M283155</link>
      <description>&lt;P&gt;I did try adding quotes around the macro variable (e.g.&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token string"&gt;PWD="&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;mypwd&lt;SPAN class="token string"&gt;";&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But SAS returns a "FATAL:&amp;nbsp; password authentication failed for user" error.&lt;/P&gt;&lt;P&gt;ERROR: Error in the LIBNAME statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 16:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/445881#M283155</guid>
      <dc:creator>tedway</dc:creator>
      <dc:date>2018-03-15T16:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable for password in Libname</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/445888#M283156</link>
      <description>&lt;P&gt;Your target won't understand the SAS password encoding. See &lt;A href="http://support.sas.com/kb/31/602.html" target="_blank"&gt;http://support.sas.com/kb/31/602.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It only seems to work with the basic password= option.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 16:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/445888#M283156</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-15T16:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable for password in Libname</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/445891#M283157</link>
      <description>&lt;P&gt;I was not able to get SAS to recognize encrypted passwords when using NOPROMPT to connect Redshift via ODBC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check with your admins and see if they can get the Server, Port and Database mapped to a DNS name so that you can just use the DNS= option instead of NOPROMPT.&amp;nbsp; Then you should be able to get it to recognize the encrypted password.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if they defined rs_server as the DSN name then your code might look like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let username=rs_user ;
%let password=raw_password ;
%let epassword={SASENC}6FE4B62604378F370E21797F12E892A9 ;

libname test odbc dsn=rs_server schema=my_schema
    user="&amp;amp;username" password="&amp;amp;epassword"
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Mar 2018 16:27:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/445891#M283157</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-15T16:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable for password in Libname</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/466820#M283158</link>
      <description>Sorry I got ERROR: Invalid option name {.&lt;BR /&gt;&lt;BR /&gt;when I ran that code.</description>
      <pubDate>Fri, 01 Jun 2018 13:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/466820#M283158</guid>
      <dc:creator>Jamwat</dc:creator>
      <dc:date>2018-06-01T13:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable for password in Libname</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/466821#M283159</link>
      <description>I got that error&lt;BR /&gt;&lt;BR /&gt;ERROR: Invalid option name {.</description>
      <pubDate>Fri, 01 Jun 2018 13:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/466821#M283159</guid>
      <dc:creator>Jamwat</dc:creator>
      <dc:date>2018-06-01T13:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable for password in Libname</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/466829#M283160</link>
      <description>&lt;P&gt;Try removing the quotes as in this example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mypassword = "passw";
libname redshift odbc datasrc=Redshift user=jdoe  password=&amp;amp;mypassword. schema=nyu;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jun 2018 13:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-for-password-in-Libname/m-p/466829#M283160</guid>
      <dc:creator>tedway</dc:creator>
      <dc:date>2018-06-01T13:35:17Z</dc:date>
    </item>
  </channel>
</rss>

