BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

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 &lt 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.

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
1 ACCEPTED SOLUTION

Accepted Solutions
Chevell_sas
SAS Employee

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>';

View solution in original post

8 REPLIES 8
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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>';

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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>';

Chevell_sas
SAS Employee

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>';

Quentin
Super User

Thanks    , that makes sense.

I had tried using ProtectSpecialChars in inline formatting, but guess that won't work. 

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Chevell_sas
SAS Employee

You are correct, as this will not be applied when added via inline formatting.

Quentin
Super User

Thanks @RW9, but the double double quotes were intentional.  I tried your suggestion and got the same results.

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Ksharp
Super User

Check style.

ods escapechar='~';

footnote1 h=3 "Visit ~S={url='www.sas.com' hreftag='blank'  } SAS ";

Quentin
Super User

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";

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 4406 views
  • 3 likes
  • 4 in conversation