<?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: ODS HTML Text url encoding problem in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-Text-url-encoding-problem/m-p/259593#M15482</link>
    <description>&lt;PRE&gt;
Quentin,
How about using URL Style ?




%let ionlist=Ca++|Na+;
%let I=%nrstr(http://www.sas.com?&amp;amp;Ion=)%sysfunc(URLencode(&amp;amp;ionlist));
%put &amp;amp;i ;

ods escapechar='~';
ods text="~S={url='&amp;amp;i'}ODS Text2 link broken";


proc print data=sashelp.class;
run;



&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Mar 2016 05:24:58 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-03-29T05:24:58Z</dc:date>
    <item>
      <title>ODS HTML Text url encoding problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-Text-url-encoding-problem/m-p/259435#M15476</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using ODS text in SAS 9.3 to write some text to an html file, and want to make a link that will look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; a href="&lt;A href="http://www.sas.com?&amp;amp;Ion=Ca++&amp;quot;" target="_blank"&gt;www.sas.com?&amp;amp;Ion=Ca++"&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Because I have those silly plus signs to deal with, I need to URL encode them to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; a href="&lt;A href="http://www.sas.com?&amp;amp;Ion=Ca%2B%2B&amp;quot;" target="_blank"&gt;www.sas.com?&amp;amp;Ion=Ca%2B%2B"&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when I do this with ODS text I end up with no % signs in the html file, I get:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; a href="&lt;A href="http://www.sas.com&amp;amp;Ion=Ca2B2B&amp;quot;" target="_blank"&gt;www.sas.com&amp;amp;Ion=Ca2B2B"&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Which doesn't work at all.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below code I try both hard coding the %2B and using URLENCODE() inline.&amp;nbsp; Both work in the title statement but not ODS text.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What am I missing? Shouldn't this work?&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;ods html file="d:\junk\myhtml.html";

title1 "&amp;lt;a href=""http://www.sas.com?%nrstr(&amp;amp;Ion=)%sysfunc(URLencode(Ca++))"")&amp;gt; Title1 link works&amp;lt;/a&amp;gt;";
title2 "&amp;lt;a href=""http://www.sas.com?%nrstr(&amp;amp;Ion=)Ca%2B%2B"")&amp;gt; Title2 link works&amp;lt;/a&amp;gt;";
ods text="&amp;lt;a href=""http://www.sas.com?%nrstr(&amp;amp;Ion=)%sysfunc(URLencode(Ca++))"")&amp;gt; ODS Text1 link broken&amp;lt;/a&amp;gt;";
ods text="&amp;lt;a href=""http://www.sas.com?%nrstr(&amp;amp;Ion=)Ca%2B%2B"")&amp;gt; ODS Text2 link broken&amp;lt;/a&amp;gt;";

proc print data=sashelp.class (obs=1);
run;

ods html close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 19:08:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-Text-url-encoding-problem/m-p/259435#M15476</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2016-03-28T19:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML Text url encoding problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-Text-url-encoding-problem/m-p/259439#M15477</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;ods text="&amp;lt;a href=""http://www.sas.com?%nrstr(&amp;amp;Ion=)Ca&lt;STRONG&gt;%%&lt;/STRONG&gt;2B&lt;STRONG&gt;%%&lt;/STRONG&gt;2B"")​&amp;gt; ODS Text2 link broken&amp;lt;/a&amp;gt;";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 19:21:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-Text-url-encoding-problem/m-p/259439#M15477</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-03-28T19:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML Text url encoding problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-Text-url-encoding-problem/m-p/259445#M15478</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw﻿&lt;/a&gt;&amp;nbsp;that works.&amp;nbsp; Curious why the extra % is needed in ODS Text?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And more importantly, is there any way to get this working with URLENCODE()?&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently I've get a data-generated macro variable &amp;amp;ionList with value like : Ca++|Na+&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which I URLENCODE().&amp;nbsp; I suppose I could double up the % signs&amp;nbsp;myself like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let ionlist=Ca++|Na+;
%put %sysfunc(transtrn(%sysfunc(URLencode(&amp;amp;ionlist)),%,%%));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But feels silly.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 19:41:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-Text-url-encoding-problem/m-p/259445#M15478</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2016-03-28T19:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML Text url encoding problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-Text-url-encoding-problem/m-p/259593#M15482</link>
      <description>&lt;PRE&gt;
Quentin,
How about using URL Style ?




%let ionlist=Ca++|Na+;
%let I=%nrstr(http://www.sas.com?&amp;amp;Ion=)%sysfunc(URLencode(&amp;amp;ionlist));
%put &amp;amp;i ;

ods escapechar='~';
ods text="~S={url='&amp;amp;i'}ODS Text2 link broken";


proc print data=sashelp.class;
run;



&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Mar 2016 05:24:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-Text-url-encoding-problem/m-p/259593#M15482</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-03-29T05:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML Text url encoding problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-Text-url-encoding-problem/m-p/259637#M15483</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;, looks like using URL style the % signs don't disappear.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 12:42:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-Text-url-encoding-problem/m-p/259637#M15483</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2016-03-29T12:42:14Z</dc:date>
    </item>
  </channel>
</rss>

