BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Within an ods markup with the html4 tagset, I'm trying to insert some html code as a navigation tool for anchors further down the document. However, when the link comes through, the # symbol has been cut off. I can't get around this - I think SAS thinks that I am trying to reference something else with this special character. Is there a way to force it to output the character "#"?

Code:

proc report data=work.anything ;
TITLE1 'Print';
TITLE2 'Contents';
run;

Output:

Print


Contents
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi!
I think you may have fallen into mismatched quote land. When I submit this code using HTML4, I get the desired results as shown below. Note the matching quotes around #print and #content. (BTW, your code shows #content in the title, but your HTML source code shows #contents in the HREF -- so I used #content in my example.)

It was my understanding that HTML attributes containing special characters or spaces had to be quoted. I think you'll get the right hyperlinks if you quote the HREF.
cynthia
[pre]
ods html4 file='c:\temp\testhref.html';
proc print data=sashelp.class;
title 'Print';
title2 'Contents';
var name age height;
run;
ods html4 close;
title;

***;
and my HTML source shows:

Print


Contents

[/pre]

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
  • 1 reply
  • 592 views
  • 0 likes
  • 2 in conversation