<?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: Redshift ODBC Connection with PROC PWENCODE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600497#M173596</link>
    <description>&lt;P&gt;I found a discouraging SAS article on this topic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"...&lt;SPAN&gt;To circumvent this problem, you must use an unencoded password when you specify the COMPLETE=, PROMPT=, REQUIRED=, and NOPROMPT= options..."&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2019 18:41:28 GMT</pubDate>
    <dc:creator>tdwilliams1</dc:creator>
    <dc:date>2019-10-30T18:41:28Z</dc:date>
    <item>
      <title>Redshift ODBC Connection with PROC PWENCODE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600358#M173519</link>
      <description>&lt;P&gt;To start my question, I would like to be clear that I am bound my systems security settings that are beyond my control &amp;lt;sigh&amp;gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Enterprise Guide 8.1 and connecting to a Redshift Database via a DSN-less ODBC connnection.&amp;nbsp; Such as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql outobs = 10 ;
connect to odbc (noprompt= "Driver={Amazon Redshift (x64)}; Server=MyServer;Database=MyDb; UID=MyUser; PWD=MyPassword; Port=0000");
select * 
from connection to odbc ( 
select distinct TableName
from pg_tables 
where schemaname = 'public' 
)
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This method works, but has the downside of displaying my password in clear text i the log.I have been experimenting with PROC PWENCODE and have successfully connected to ORACLE and Netezza databases using the results from PROC PWENCODE.&amp;nbsp; I have not been able to connect to redshift using the PWENCODE value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried simply replacing my password in the above code with the PWENCODE string, which did not work.&amp;nbsp; I tried enclosing in single quotes which did not work either. I tried a set of double quotes, which did not work either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know using PWENCODE is NOT encryption, but our current system does not support integrated authentication, so I'm stuck using passwords. Has anyone been able to use PWENCODE with the Redshift ODBC driver without creating a DSN file?&amp;nbsp; If so, how did you construct your connection string?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 12:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600358#M173519</guid>
      <dc:creator>tdwilliams1</dc:creator>
      <dc:date>2019-10-30T12:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Redshift ODBC Connection with PROC PWENCODE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600369#M173523</link>
      <description>&lt;P&gt;I think the problem is that when you use a NOPROMPT statement, the literal string inside the quotes is passed to ODBC. But I think it is possible to put the user and password outside the noprompt part of the connection, e.g.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;connect to odbc(noprompt= "Driver={Amazon Redshift (x64)}; Server=MyServer;Database=MyDb; Port=0000"  user=MyUser password=MyPassword)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and I think that when done like that, SAS will deencrypt an encrypted password.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 13:28:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600369#M173523</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-10-30T13:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Redshift ODBC Connection with PROC PWENCODE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600404#M173545</link>
      <description>&lt;P&gt;s_Lassen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the suggestion!&amp;nbsp; Unfortunately I am still having trouble connecting&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing to&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;connect to odbc (
noprompt= "Driver={Amazon Redshift (x64)}; 
Server=MyServer;
Database=MyDb; 
UID=MyUser; 
Port=0000"

PWD=MyPassword

);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Generates the following error:&lt;/P&gt;&lt;P&gt;ERROR: CLI error trying to establish connection: [Amazon][DSI] (20032) Required setting 'PWD' is not present in the connection&lt;BR /&gt;settings.&lt;/P&gt;&lt;P&gt;Moving the UID out of the quoted string creates a similar error for the UID.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 14:12:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600404#M173545</guid>
      <dc:creator>tdwilliams1</dc:creator>
      <dc:date>2019-10-30T14:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Redshift ODBC Connection with PROC PWENCODE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600497#M173596</link>
      <description>&lt;P&gt;I found a discouraging SAS article on this topic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"...&lt;SPAN&gt;To circumvent this problem, you must use an unencoded password when you specify the COMPLETE=, PROMPT=, REQUIRED=, and NOPROMPT= options..."&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 18:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600497#M173596</guid>
      <dc:creator>tdwilliams1</dc:creator>
      <dc:date>2019-10-30T18:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Redshift ODBC Connection with PROC PWENCODE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600504#M173600</link>
      <description>&lt;P&gt;Unfortunately, without integrated authentication, I think you are stuck. We use the same technique you use - DSN-less ODBC connections - but to SQL Server using&amp;nbsp;integrated authentication and it works a treat. Much better than maintaining DSNs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your case though it looks like using DSNs is the only way to avoid passwords showing. You could perhaps define your password in a macro variable but you would still have to set that up somewhere so you are not much better off.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 19:13:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600504#M173600</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-10-30T19:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Redshift ODBC Connection with PROC PWENCODE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600565#M173628</link>
      <description>&lt;P&gt;If you don't use the NOPROMPT option, the password shows as Xs in the log.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt; libname GDW&amp;nbsp; odbc user="&amp;amp;username" password="&amp;amp;password" schema=NW datasrc=SR access=readonly;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 21:51:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600565#M173628</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-10-30T21:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Redshift ODBC Connection with PROC PWENCODE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600658#M173673</link>
      <description>&lt;P&gt;Found another solution that seems to work: Use the connection string as input to PROC PWENCODE, and then use the output value in the noprompt value:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc PWENCODE in="Driver={Amazon Redshift (x64)}; Server=MyServer;Database=MyDb; UID=MyUser; PWD=MyPassword; Port=0000";
run;&lt;BR /&gt;%let constr=NOPROMPT="&amp;amp;_PWENCODE";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can then use the Constr macro variable for connection:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  Connect to odbc(&amp;amp;constr);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The reason I saved the value in the macro variable CONSTR and did not use the automatic variable _PWENCODE directly is that you may be using PROC PWENCODE for other stuff, which will change the value of _PWENCODE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 10:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600658#M173673</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-10-31T10:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Redshift ODBC Connection with PROC PWENCODE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600713#M173692</link>
      <description>&lt;P&gt;is format works for LIBNAME, but not for Pass through&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 14:47:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600713#M173692</guid>
      <dc:creator>tdwilliams1</dc:creator>
      <dc:date>2019-10-31T14:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Redshift ODBC Connection with PROC PWENCODE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600714#M173693</link>
      <description>&lt;P&gt;That did it!&amp;nbsp; THANKS!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 14:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600714#M173693</guid>
      <dc:creator>tdwilliams1</dc:creator>
      <dc:date>2019-10-31T14:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Redshift ODBC Connection with PROC PWENCODE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600720#M173696</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76464"&gt;@s_lassen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is great!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 15:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600720#M173696</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-31T15:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Redshift ODBC Connection with PROC PWENCODE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600852#M173745</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;works for LIBNAME, but not for Pass through&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname GDW&amp;nbsp; odbc user="&amp;amp;username" password="&amp;amp;password" schema=NW datasrc=SR access=readonly;

proc sql;
&amp;nbsp; connect using GDW;
&amp;nbsp; select * from connection to GDW (&amp;nbsp; &amp;nbsp;passthru&amp;nbsp;code &amp;nbsp; );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 22:23:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Redshift-ODBC-Connection-with-PROC-PWENCODE/m-p/600852#M173745</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-10-31T22:23:26Z</dc:date>
    </item>
  </channel>
</rss>

