The SAS Output Delivery System and reporting techniques

ods escapechar makes the data disappear in a HTML report

Reply
Super Contributor
Posts: 260

ods escapechar makes the data disappear in a HTML report

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
SAS Super FREQ
Posts: 8,743

Re: ods escapechar makes the data disappear in a HTML report

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
Super Contributor
Posts: 260

Re: ods escapechar makes the data disappear in a HTML report

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
Ask a Question
Discussion stats
  • 2 replies
  • 131 views
  • 0 likes
  • 2 in conversation