BookmarkSubscribeRSS Feed
Olivier
Pyrite | Level 9
Hi all.
Here is the problem I am facing : I try to add some superscript numbers in labels on a listing, to send the reader to a note included in a footnote. When I do that in a Print or Sql procedure to produce my report, the data disappears from my report, leaving just a blank column -- the label disappears as well in Print, but not in Sql.
Here is my sample code : any ideas why this happens, and what lesson should be learn from that, such as "Thou shalt not include superscript escapechar in HTML reports" ?
[pre]
ODS HTML FILE = "c:\temp\special.htm" ;
ODS ESCAPECHAR = "^" ;
FOOTNOTE1 "^{super 1}in inches ; ^{super 2}in pounds" ;
PROC SQL ;
SELECT name, age,
height LABEL = "Height^{super 1}",
weight LABEL = "Weight^{super 2}"
FROM sashelp.class ;
QUIT ;
PROC PRINT DATA = sashelp.class LABEL NOOBS ;
VAR name age height weight ;
LABEL height = "Height^{super 1}" weight = "Weight^{super 2}" ;
RUN ;
FOOTNOTE ;
ODS HTML CLOSE ;
[/pre]
Thanks in advance.
Olivier
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi, Olivier:
I have seen this issue sporadically. Try ODS HTML3/ODS HTML3 CLOSE instead of ODS HTML and I think it'll work OK.

Also, PROC REPORT doesn't seem to have the problem with ODS HTML that PROC PRINT has, I'm not sure why. The equivalent code in PROC REPORT land is:
[pre]
** generate HTML 3.2 tags -- should work OK;

ODS html3 FILE = "c:\temp\special3.htm" ;
ODS ESCAPECHAR = "^" ;
FOOTNOTE1 "^{super 1}in inches ; ^{super 2}in pounds" ;

title 'proc sql and HTML 3';
PROC SQL ;
SELECT name, age,
height LABEL = "Height^{super 1}",
weight LABEL = "Weight^{super 2}"
FROM sashelp.class ;
QUIT ;

PROC PRINT DATA = sashelp.class LABEL NOOBS;
title 'proc print and HTML 3';
VAR name age height weight ;
LABEL height = "Height^{super 1}"
weight = "Weight^{super 2}" ;
RUN ;

PROC report DATA = sashelp.class nowd;
title 'proc report and HTML 3';
column name age height weight ;
LABEL height = "Height^{super 1}"
weight = "Weight^{super 2}" ;
RUN ;

title;
FOOTNOTE ;
ODS html3 CLOSE ;


** generate HTML 4.0 tags -- no problem with PROC REPORT;

ODS html FILE = "c:\temp\special4.htm" ;
ODS ESCAPECHAR = "^" ;
FOOTNOTE1 "^{super 1}in inches ; ^{super 2}in pounds" ;

PROC report DATA = sashelp.class nowd;
title 'proc report and HTML 4';
column name age height weight ;
LABEL height = "Height^{super 1}"
weight = "Weight^{super 2}" ;
RUN ;

title;
FOOTNOTE ;
ODS html CLOSE ;
[/pre]

cynthia
Olivier
Pyrite | Level 9
Thank you Cynthia : it does work fine with HTML3.
I was sure when I posted this question that you will answer saying that proc Report does the job perfectly 🙂 So I didn't even bother to test the Report solution, being sure you would do it for me...

Thanks a lot. I'm waiting for an update in the HTML4 tagset to solve the problem...

Olivier

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 670 views
  • 0 likes
  • 2 in conversation