<?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: passing &amp;amp; symbol in proc http in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/passing-amp-symbol-in-proc-http/m-p/559016#M156063</link>
    <description>&lt;P&gt;Thank you for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It gives me the same result as the original code. It works for passwords that do not have '&amp;amp;' character, but fails if the password has that character.&amp;nbsp;When I look at 'input', the password is resolving correctly though.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 May 2019 15:29:59 GMT</pubDate>
    <dc:creator>putteringpluie</dc:creator>
    <dc:date>2019-05-15T15:29:59Z</dc:date>
    <item>
      <title>passing &amp; symbol in proc http</title>
      <link>https://communities.sas.com/t5/SAS-Programming/passing-amp-symbol-in-proc-http/m-p/558959#M156041</link>
      <description>&lt;P&gt;I have the following code which fails if users have the character '&amp;amp;' in their password (myPW).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that data _null_ statement is working as expected 'input' is resolving to the correct string. The problem seems to be in the 'in=' statement in proc http. How do I make sure that the correct string is being input in proc http?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename input TEMP;
filename resp TEMP;
filename headers TEMP;


%LET myPW=%STR(xxxxxx);
%LET myID=%STR(xxxxxx);

data _null_;
	file input recfm=f lrecl=1;
	put "RS_action=signOn%nrstr(&amp;amp;RS_userName)=&amp;amp;myID.%nrstr(&amp;amp;RS_password)=&amp;amp;myPW";
run;




proc http
	method="POST"
	url="http://xxxxx:####"
	in=input
	headerout=headers
	out=resp
	HEADEROUT_OVERWRITE;
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;SAS version 9.4&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 14:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/passing-amp-symbol-in-proc-http/m-p/558959#M156041</guid>
      <dc:creator>putteringpluie</dc:creator>
      <dc:date>2019-05-15T14:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: passing &amp; symbol in proc http</title>
      <link>https://communities.sas.com/t5/SAS-Programming/passing-amp-symbol-in-proc-http/m-p/558999#M156058</link>
      <description>&lt;P&gt;You need to show what you think the resulting text should look like.&lt;/P&gt;
&lt;P&gt;If you want to use &amp;amp; in your strings without SAS thinking you want to reference a macro variable then why not just use single quotes?&lt;/P&gt;
&lt;P&gt;Also not sure how you expect SAS write such a long string to a file that has records of only 1 byte each?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET myPW=%STR(xxxxxx);
%LET myID=%STR(xxxxxx);

data _null_;
  file input ;
  put 'RS_action=signOn&amp;amp;RS_userName=' "&amp;amp;myID." '&amp;amp;RS_password=' "&amp;amp;myPW";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 15:10:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/passing-amp-symbol-in-proc-http/m-p/558999#M156058</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-15T15:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: passing &amp; symbol in proc http</title>
      <link>https://communities.sas.com/t5/SAS-Programming/passing-amp-symbol-in-proc-http/m-p/559016#M156063</link>
      <description>&lt;P&gt;Thank you for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It gives me the same result as the original code. It works for passwords that do not have '&amp;amp;' character, but fails if the password has that character.&amp;nbsp;When I look at 'input', the password is resolving correctly though.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 15:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/passing-amp-symbol-in-proc-http/m-p/559016#M156063</guid>
      <dc:creator>putteringpluie</dc:creator>
      <dc:date>2019-05-15T15:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: passing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/passing-amp-symbol-in-proc-http/m-p/559027#M156066</link>
      <description>&lt;P&gt;The use URLENCODE() function to convert the string before writing it.&lt;BR /&gt;Or possible you want the HTMLENCODE() function instead.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 15:49:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/passing-amp-symbol-in-proc-http/m-p/559027#M156066</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-15T15:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: passing &amp; symbol in proc http</title>
      <link>https://communities.sas.com/t5/SAS-Programming/passing-amp-symbol-in-proc-http/m-p/559802#M156383</link>
      <description>Thank you. Searching for urlencode lead me to this: &lt;A href="https://blogs.sas.com/content/sasdummy/2018/04/04/htmlencode-urlencode/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2018/04/04/htmlencode-urlencode/&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Which told me that I have to use urlencode function so I can 'eecape' the ampersand symbol in my code. Adding that funtion to my password variable helped me resolve this issue.</description>
      <pubDate>Fri, 17 May 2019 21:41:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/passing-amp-symbol-in-proc-http/m-p/559802#M156383</guid>
      <dc:creator>putteringpluie</dc:creator>
      <dc:date>2019-05-17T21:41:38Z</dc:date>
    </item>
  </channel>
</rss>

