<?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: htmldecode function in open code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/htmldecode-function-in-open-code/m-p/502553#M134167</link>
    <description>&lt;P&gt;The htmlencode function is a data step function. If you want this to work in open (or macro) code you need to wrap it inside a %sysfunc call e.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Global x1 x2; 
%let x1 = 'not a &amp;amp;lt;tag&amp;amp;gt;';
%Put &amp;amp;x1;
%let x2 = %sysfunc(htmldecode(&amp;amp;x1));
%put &amp;amp;x2; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can find more details on how to use %sysfunc here -&amp;gt;&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p1o13d7wb2zfcnn19s5ssl2zdxvi.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p1o13d7wb2zfcnn19s5ssl2zdxvi.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Oct 2018 00:01:53 GMT</pubDate>
    <dc:creator>ChrisBrooks</dc:creator>
    <dc:date>2018-10-09T00:01:53Z</dc:date>
    <item>
      <title>htmldecode function in open code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/htmldecode-function-in-open-code/m-p/502546#M134163</link>
      <description>&lt;P&gt;All,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Wondering whats wrong in the open code that I am trying here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; The following works in a data step&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Test; 
	x1 = 'not a &amp;amp;lt;tag&amp;amp;gt;';
	x2 = htmldecode(x1);
Run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;However, when I move away from a datastep into open code, this fails(does not return an error, but does not have the desired impact. desired impact/result is demonstrated in data step):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Global x1 x2; 
%let x1 = 'not a &amp;amp;lt;tag&amp;amp;gt;';
%Put &amp;amp;x1;
%let x2 = htmldecode(&amp;amp;x1); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; Can somebody kindly explain why ? The desired output is demonstrated in the data step.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 22:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/htmldecode-function-in-open-code/m-p/502546#M134163</guid>
      <dc:creator>UdayGuntupalli</dc:creator>
      <dc:date>2018-10-08T22:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: htmldecode function in open code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/htmldecode-function-in-open-code/m-p/502553#M134167</link>
      <description>&lt;P&gt;The htmlencode function is a data step function. If you want this to work in open (or macro) code you need to wrap it inside a %sysfunc call e.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Global x1 x2; 
%let x1 = 'not a &amp;amp;lt;tag&amp;amp;gt;';
%Put &amp;amp;x1;
%let x2 = %sysfunc(htmldecode(&amp;amp;x1));
%put &amp;amp;x2; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can find more details on how to use %sysfunc here -&amp;gt;&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p1o13d7wb2zfcnn19s5ssl2zdxvi.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p1o13d7wb2zfcnn19s5ssl2zdxvi.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 00:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/htmldecode-function-in-open-code/m-p/502553#M134167</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2018-10-09T00:01:53Z</dc:date>
    </item>
  </channel>
</rss>

