<?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: Unable to give hyperlink to a word in a sentence ...please help.... in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16766#M3496</link>
    <description>Hi Cynthia,&lt;BR /&gt;
&lt;BR /&gt;
Thanks ...its working by using the "style(data)={protectspecialchars=off}"&lt;BR /&gt;
  &lt;BR /&gt; Its working in proc print.So is there any way to use this by the _null_ and file print?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
Thanks a lot&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
Solo</description>
    <pubDate>Mon, 20 Jun 2011 00:15:00 GMT</pubDate>
    <dc:creator>Solo</dc:creator>
    <dc:date>2011-06-20T00:15:00Z</dc:date>
    <item>
      <title>Unable to give hyperlink to a word in a sentence ...please help....</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16763#M3493</link>
      <description>Hi All,&lt;BR /&gt;
 &lt;BR /&gt;
    I had a situation where i need to provide a hyperlink to a particular word in a sentence when output in html. For example:&lt;BR /&gt;
  "A Professional SAS Programmer."&lt;BR /&gt;
  and I need to give the hyperlink to "Professional" and am able to give the link to the whole sentence but not for the particular word i needed.&lt;BR /&gt;
&lt;BR /&gt;
Below is the code am using:&lt;BR /&gt;
&lt;BR /&gt;
A &lt;A target="_blank" href="http://en.wikipedia.org/wiki/Professional"&gt;Professional&lt;/A&gt; SAS Programmer.&lt;BR /&gt;
&lt;BR /&gt;
and its giving the exact html code in the output rather than hyperlink and when i checked the HTML source code it is as below:&lt;BR /&gt;
&lt;BR /&gt;
A &amp;lt;a target='_blank'href='http://en.wikipedia.org/wiki/Professional'&amp;gt;Professional&amp;lt;/a&amp;gt; SAS Programmer.&lt;BR /&gt;
&lt;BR /&gt;
Please Help...&lt;BR /&gt;
&lt;BR /&gt;
Thanks In Advance...&lt;BR /&gt;
Solo</description>
      <pubDate>Sun, 19 Jun 2011 11:24:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16763#M3493</guid>
      <dc:creator>Solo</dc:creator>
      <dc:date>2011-06-19T11:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to give hyperlink to a word in a sentence ...please help....</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16764#M3494</link>
      <description>Hi:&lt;BR /&gt;
  You show the HTML code you are using, but not the SAS code you are using. Your use of HTML implies that your destination of choice is ODS HTML, but it would be useful to see your SAS code, plus your ODS code. Seeing your SAS code would help determine whether you are writing DATA step code, using PROC PRINT, PROC REPORT or ...??? &lt;BR /&gt;
 &lt;BR /&gt;
  When you post code with HTML tags or &amp;lt; symbols or &amp;gt; symbols, you need to protect those HTML symbols from the forum posting mechanism mistakenly interpreting them as HTML tags aimed at formatting your post (instead of being just part of the code). You will need to use search and replace prior to posting in order to &lt;BR /&gt;
1) convert the &amp;lt; symbol to &amp;amp;lt; (ampersand-lt-semicolon)&lt;BR /&gt;
 and&lt;BR /&gt;
2) convert the &amp;gt; symbol to &amp;amp;gt; (ampersand-gt-semicolon)&lt;BR /&gt;
&lt;BR /&gt;
  Meanwhile, the code below is an example that works for me.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data class;&lt;BR /&gt;
  length job $125;&lt;BR /&gt;
  set sashelp.class;&lt;BR /&gt;
  where name in ('Alfred', 'Barbara');&lt;BR /&gt;
  if name = 'Alfred' then &lt;BR /&gt;
     job = catx(' ',"A &amp;lt;a target='_blank' href='http://en.wikipedia.org/wiki/Professional'&amp;gt;Professional&amp;lt;/a&amp;gt;",' SAS programmer');&lt;BR /&gt;
  if name = 'Barbara' then  &lt;BR /&gt;
     job = catx(' ',"A Professional &amp;lt;a target='_blank' href='http://www.sas.com'&amp;gt;SAS&amp;lt;/a&amp;gt;",'programmer');&lt;BR /&gt;
run;&lt;BR /&gt;
                         &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\use_url_word.html' style=sasweb;&lt;BR /&gt;
                &lt;BR /&gt;
proc print data=class noobs&lt;BR /&gt;
     style(data)={protectspecialchars=off};&lt;BR /&gt;
  var name age sex height weight job;&lt;BR /&gt;
run;&lt;BR /&gt;
         &lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Sun, 19 Jun 2011 18:29:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16764#M3494</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-06-19T18:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to give hyperlink to a word in a sentence ...please help....</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16765#M3495</link>
      <description>Hi Cynthia...First of all thanks a lot for the response.&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
Below is the SAS code am using to set the hyperlink to the word "Professional":&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;
filename seercode URL "http://www.bestsampleresume.com/resume-templates/sample-accounting-resume-template-1.html" debug lrecl=32767;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;
data html1(drop= v v1 rx1);&lt;BR /&gt;&lt;BR /&gt;
  infile seercode truncover;&lt;BR /&gt;&lt;BR /&gt;
  input @1 v $32767.;&lt;BR /&gt;&lt;BR /&gt;
  format v1 v2 $32767.;&lt;BR /&gt;&lt;BR /&gt;
     v1=htmldecode(v);&lt;BR /&gt;&lt;BR /&gt;
     if substr(v1,1,3)='&amp;lt;p&amp;gt;' or substr(v1,1,3)='&amp;lt;B&amp;gt;' or&lt;BR /&gt;
        substr(v1,1,4)='&amp;lt;br&amp;gt;' or substr(v1,1,4)='&amp;lt;/B&amp;gt;' or substr(v1,1,4)='&amp;lt;LI&amp;gt;' or substr(v1,1,8)='&amp;lt;CENTER&amp;gt;';&lt;BR /&gt;&lt;BR /&gt;
     v2=v1;&lt;BR /&gt;&lt;BR /&gt;
     rx1=prxparse("s/&amp;lt;(.|\n)*?&amp;gt;//");&lt;BR /&gt;&lt;BR /&gt;
                                  &lt;BR /&gt;
     call prxchange(rx1,-1,v2);/* Performs a pattern-matching replacement and -1 indicates replace all the pattern available */&lt;BR /&gt;&lt;BR /&gt;
     if v2=' ' then delete;&lt;BR /&gt;&lt;BR /&gt;
run;&lt;BR /&gt;&lt;BR /&gt;
&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;
data html2;&lt;BR /&gt;&lt;BR /&gt;
   length x $32767;&lt;BR /&gt;&lt;BR /&gt;
  set html1;&lt;BR /&gt;&lt;BR /&gt;
    x=tranwrd(v2,'Professional',cat('&amp;lt;a target=',"'_blank'",' href="http://en.wikipedia.org/wiki/Professional"&amp;gt;Professional'));&lt;BR /&gt;&lt;BR /&gt;
run;&lt;BR /&gt;&lt;BR /&gt;
&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;
ods html body='C:\Documents and Settings\sasadm\Desktop\resume.html' style=minimal;&lt;BR /&gt;&lt;BR /&gt;
&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;
data _null_; &lt;BR /&gt;&lt;BR /&gt;
  set html2;&lt;BR /&gt;&lt;BR /&gt;
	file print;&lt;BR /&gt;&lt;BR /&gt;
	put x;&lt;BR /&gt;&lt;BR /&gt;
run;&lt;BR /&gt;&lt;BR /&gt;
&lt;/P&gt;&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks In Advance...&lt;BR /&gt;&lt;BR /&gt;
Solo

Message was edited by: Solo</description>
      <pubDate>Mon, 20 Jun 2011 00:10:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16765#M3495</guid>
      <dc:creator>Solo</dc:creator>
      <dc:date>2011-06-20T00:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to give hyperlink to a word in a sentence ...please help....</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16766#M3496</link>
      <description>Hi Cynthia,&lt;BR /&gt;
&lt;BR /&gt;
Thanks ...its working by using the "style(data)={protectspecialchars=off}"&lt;BR /&gt;
  &lt;BR /&gt; Its working in proc print.So is there any way to use this by the _null_ and file print?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
Thanks a lot&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
Solo</description>
      <pubDate>Mon, 20 Jun 2011 00:15:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16766#M3496</guid>
      <dc:creator>Solo</dc:creator>
      <dc:date>2011-06-20T00:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to give hyperlink to a word in a sentence ...please help....</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16767#M3497</link>
      <description>Hi:&lt;BR /&gt;
  This is the incorrect syntax for working with ODS and FILE PRINT:&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;file print;&lt;/I&gt;&lt;/B&gt;&lt;I&gt;&lt;/I&gt;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                   &lt;BR /&gt;
You should be using:[pre]&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;file print ods;&lt;/I&gt;&lt;/B&gt;&lt;I&gt;&lt;/I&gt;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
              &lt;BR /&gt;
But that would still not change your issue of how to pass in the protectspecialchars=off. If you really WANT to use DATA _NULL_, you would have 3 choices:&lt;BR /&gt;
1) abandon the ODS HTML "sandwich" and write ALL your HTML tags in the DATA step program. In this case, the FILE PRINT with PUT statements (a very useful technique when you want to create an output file) would create a plain ASCII text file and the issue of "protection" of special characters would become irrelevant.&lt;BR /&gt;
or&lt;BR /&gt;
2) try to change the style template to add PROTECTSPECIALCHARS=OFF to the DATA element (and change your syntax to use FILE PRINT ODS -- so you actually have a DATA element in the resulting output)&lt;BR /&gt;
or&lt;BR /&gt;
3) create a custom TABLE template for use with you DATA _NULL_ technique, as illustrated in this paper (you can add style overrides to your DEFINE/END block of code): &lt;A href="http://www2.sas.com/proceedings/sugi30/088-30.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi30/088-30.pdf&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
But, to me, it is far simpler to use PROC PRINT and a simple STYLE= override than to learn the DATA _NULL_ required for #1; the STYLE template and new syntax required for #2; or the TABLE template and new syntax required for #3. IMHO, ODS makes your life so much easier because you CAN use STYLE= overrides with PROC PRINT in order to pass a URL to an HTML file created by ODS.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
&lt;BR /&gt;
Using the previously posted data from SASHELP.CLASS, an example of #1 technique would be (WITHOUT any ODS HTML statements) -- essentially, this technique is how a programmer would write ASCII text HTML files from SAS datasets in the "old" days -- before ODS:&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
** DATA _NULL_ to write ALL HTML tags;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  file 'c:\temp\myexamp.html';&lt;BR /&gt;
  set class end=eof;&lt;BR /&gt;
  if _n_ = 1 then do;&lt;BR /&gt;
    put @1 '&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"&amp;gt;';&lt;BR /&gt;
    put @1 '&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;my example&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;';&lt;BR /&gt;
    put @3 '&amp;lt;center&amp;gt;&amp;lt;table border=1&amp;gt;&amp;lt;thead&amp;gt;';&lt;BR /&gt;
    put @5 '&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Name&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Age&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Job&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/thead&amp;gt;&amp;lt;tbody&amp;gt;';&lt;BR /&gt;
  end;&lt;BR /&gt;
  put @5 '&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;' Name '&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;' Age 2.0 '&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;' Job '&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;';&lt;BR /&gt;
  if eof then do;&lt;BR /&gt;
    put @3 '&amp;lt;/center&amp;gt;&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;';&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 20 Jun 2011 01:04:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16767#M3497</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-06-20T01:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to give hyperlink to a word in a sentence ...please help....</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16768#M3498</link>
      <description>Hi Cynthia,&lt;BR /&gt;
&lt;BR /&gt;
  &lt;BR /&gt;Thanks for the Help and for providing the details.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;Regards&lt;BR /&gt;
&lt;BR /&gt;Solo</description>
      <pubDate>Tue, 21 Jun 2011 03:31:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Unable-to-give-hyperlink-to-a-word-in-a-sentence-please-help/m-p/16768#M3498</guid>
      <dc:creator>Solo</dc:creator>
      <dc:date>2011-06-21T03:31:18Z</dc:date>
    </item>
  </channel>
</rss>

