<?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: How to mask the special character(/) in url of proc http in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-mask-the-special-character-in-url-of-proc-http/m-p/811822#M320246</link>
    <description>&lt;P&gt;how about this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symputx('url','https://xxxxxxxxx/xxxx/xxxx/'||trim(urlencode('x-xx-xxx-x/x'))||'/xxxxxxxxx');
run;
Proc http url="&amp;amp;url"
  method='GET'
  out=testing;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 May 2022 09:34:57 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2022-05-06T09:34:57Z</dc:date>
    <item>
      <title>How to mask the special character(/) in url of proc http</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-mask-the-special-character-in-url-of-proc-http/m-p/811810#M320240</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;I am working for customer, where customer is not given direct access to databases. So, provided the API to fetch the data. In the process, same api i need to call for each well. so , I have written the macro. so for the one the well name has specical character (/) i.e x-xx-xxx-x/x so when i am passing the macro parmeter, it is resolving to&amp;nbsp;x-xx-xxx-x/x as there is forward slash in the well name, it treating url is different and throwing the error. I used the function urlencode funtion it is throwing the error or process is continue to run..without giving any error or data&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Proc https&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url="&lt;A href="https://xxxxxxxxx/xxxx/xxxx/" target="_blank"&gt;https://xxxxxxxxx/xxxx/xxxx/&lt;/A&gt; &lt;SPAN&gt;x-xx-xxx-x/x&lt;/SPAN&gt;/xxxxxxxxx"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; method='GET'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=testing;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Proc https&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url="&lt;A href="https://xxxxxxxxx/xxxx/xxxx/" target="_blank"&gt;https://xxxxxxxxx/xxxx/xxxx/&lt;/A&gt; urlencode(&lt;SPAN&gt;x-xx-xxx-x/x)&lt;/SPAN&gt;/xxxxxxxxx"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; method='GET'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=testing;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Narahari&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 08:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-mask-the-special-character-in-url-of-proc-http/m-p/811810#M320240</guid>
      <dc:creator>harigottala0</dc:creator>
      <dc:date>2022-05-06T08:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to mask the special character(/) in url of proc http</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-mask-the-special-character-in-url-of-proc-http/m-p/811822#M320246</link>
      <description>&lt;P&gt;how about this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symputx('url','https://xxxxxxxxx/xxxx/xxxx/'||trim(urlencode('x-xx-xxx-x/x'))||'/xxxxxxxxx');
run;
Proc http url="&amp;amp;url"
  method='GET'
  out=testing;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 May 2022 09:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-mask-the-special-character-in-url-of-proc-http/m-p/811822#M320246</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-05-06T09:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to mask the special character(/) in url of proc http</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-mask-the-special-character-in-url-of-proc-http/m-p/811867#M320275</link>
      <description>&lt;P&gt;All URLENCODE() will do is convert the slash into %2F.&lt;/P&gt;
&lt;P&gt;Does it work if you convert the / into %2F in the call?&lt;/P&gt;
&lt;P&gt;Try it with a specific file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it works then here is how you can call URLENCODE().&amp;nbsp; Either do it for real in a data step.&lt;/P&gt;
&lt;P&gt;Or call with %SYSFUNC() in macro code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;245  data test;
246    string='x-xx-xxx-x/x';
247    ustring=urlencode(trim(string));
248    put (_all_) (= :$quote.);
249  run;

string="x-xx-xxx-x/x" ustring="x-xx-xxx-x%2Fx"
NOTE: The data set WORK.TEST has 1 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


250
251  %let string=x-xx-xxx-x/x ;
252  %put &amp;amp;=string -&amp;gt; %sysfunc(urlencode(&amp;amp;string)) ;
STRING=x-xx-xxx-x/x -&amp;gt; x-xx-xxx-x%2Fx
&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 May 2022 13:24:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-mask-the-special-character-in-url-of-proc-http/m-p/811867#M320275</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-05-06T13:24:27Z</dc:date>
    </item>
  </channel>
</rss>

