Hi,
I'm using ODS HTML with SAS 9.3 and want a simple footnote with a link in it. Below are four attempts:
footnote1 h=3 "Visit <a href=""http://www.sas.com""> SAS </a>";
footnote2 h=3 "<p> Visit <a href=""http://www.sas.com""> SAS </a>";
footnote3 h=3 "<p> Visit <a href=""http://www.sas.com""> SAS </a> to see good stuff";
footnote4 h=3 "<p> Visit <a href=""http://www.sas.com""> SAS to see good stuff</a>";
Footnote1 does not work. The angle brackets are htmlencoded into < etc, and I don't get a link.
Someone said if I added <p> to the front, SAS would know this is html code, and would leave the tags alone. Footnote2 works.
Then I wanted to add some text after the link. Footnote 3 does not work. Again, the angle brackets get encoded.
Footnote4 does work, because now there is no text after the link. Instead "to see good stuff" is part of the link.
Any way to get footnote3 to work?
Should I be doing this a different way?
Actual setting is Stored Process Web App where footnotes will let users drill down. But I see the same with just base SAS ods html.
Thanks,
--Q.
By default if the first and last character are not tags, the tag in between gets encoded. You can add HTML blocking tags to the beginning and end of the footnote statement or use the PROTECTSPACIALCHARS= style attribute within the SystemFooter style element.
footnote1 h=3 '<span>Visit <a href="http://www.sas.com"> SAS </a>'</span>;
footnote2 h=3 '<span> Visit <a href="http://www.sas.com"> SAS </a></span>';
footnote3 h=3 '<span> Visit <a href="http://www.sas.com"> SAS </a> to see good stuff'</span>;
footnote4 h=3 '<span> Visit <a href="http://www.sas.com"> SAS to see good stuff</a></span>';
Hi,
I would suggest that you check your quote marks. I copied this into SAS and I see there is a quote before the <p>, then two before the http, two after, then a final one. Maybe set double quote 1 and last one to single:
E.g.
h=3 '<p> Visit <a href="http://www.sas.com"> SAS </a>';
So without the formatting:
footnote1 h=3 'Visit <a href="http://www.sas.com"> SAS </a>';
footnote2 h=3 '<p> Visit <a href="http://www.sas.com"> SAS </a>';
footnote3 h=3 '<p> Visit <a href="http://www.sas.com"> SAS </a> to see good stuff';
footnote4 h=3 '<p> Visit <a href="http://www.sas.com"> SAS to see good stuff</a>';
By default if the first and last character are not tags, the tag in between gets encoded. You can add HTML blocking tags to the beginning and end of the footnote statement or use the PROTECTSPACIALCHARS= style attribute within the SystemFooter style element.
footnote1 h=3 '<span>Visit <a href="http://www.sas.com"> SAS </a>'</span>;
footnote2 h=3 '<span> Visit <a href="http://www.sas.com"> SAS </a></span>';
footnote3 h=3 '<span> Visit <a href="http://www.sas.com"> SAS </a> to see good stuff'</span>;
footnote4 h=3 '<span> Visit <a href="http://www.sas.com"> SAS to see good stuff</a></span>';
I had tried using ProtectSpecialChars in inline formatting, but guess that won't work.
You are correct, as this will not be applied when added via inline formatting.
Thanks @RW9, but the double double quotes were intentional. I tried your suggestion and got the same results.
Check style.
ods escapechar='~';
footnote1 h=3 "Visit ~S={url='www.sas.com' hreftag='blank' } SAS ";
Thanks Ksharp, looks like using in-line formatting may work. To get the text at the end to be not part of the link, I added a null style:
footnote1 h=3 "Visit ~S={url='www.sas.com' } SAS~S={} to see good stuff";
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.