The SAS Output Delivery System and reporting techniques

ODS HTML Footnote with HREF

Reply
Frequent Contributor
Posts: 78

ODS HTML Footnote with HREF

You guys been awesome in helping me ...So here's another one :-)

I am looking if could have TABS or DRILL Down option with the ODS HTML  ...Specially since i have following as a code:

data x ;

set  y;

ods trace on;                                          

ods noproctitle;                                       

ods listing close ;                                    

ods html                                           

    path=datasetname                                     

    Base="//xx/MVSDS/"         

    body="&odsmem"                                     

    record_seperator=none                              

    style=barrettsblue                                 

    newfile=page;                                     

proc report data=x ;

proc summary data=x ;

proc freq data=x;

ods html close;

run;

Now with this the Body members are created for each Proc statement and that's not fitting with my requirement....I was looking if I could have Proc Report as a Main output then at the footnote I have option to drill down to proc summary and proc freq so i tried with the HREF option as below :-

data x ;

set  y;

ods trace on;                                          

ods noproctitle;                                       

ods listing close ;                                    

ods html                                           

    path=datasetname                                     

    Base="//xx/MVSDS/"         

    body="&odsmem"                                     

    record_seperator=none                              

    style=barrettsblue                                 

    newfile=page;                                     

proc report data=x ;

footnote  <A HREF='XXXXXX'   </a> ;  

proc summary data=x ;

  footnote  <A HREF='XXXXXX'   </a> ; 

proc freq data=x;

footnote  <A HREF='XXXXXX'   </a> ; 

ods html close;

run;

However I also get message of mismatch quotes or missing quotes for the dataset name in the HREF like it resolve to

https://x/MVSDS/Y.SHR.HTML(X)    ====which is without quote 

There's another error i found where it says HREF number of characters exceeded if i put the complete address for the Webaddress....

Could somebody point me to good example of either having webtabs with the ODS HTML or having HREF option with the lengthy and quoted webaddress...thanks for your help....

Again with this I thankyou specially Cynthia who been really good with the tricks provided... 

Super User
Super User
Posts: 7,716

Re: ODS HTML Footnote with HREF

Well, your footnote statement is throwing up an error because you need quotes all the way round it, e.g.:

footnote "<a href='XXXXX' </a>";

Length is likely to be an issue with footnotes as there is a maximum it can handle i.e. imagine a physical page having only a certain amount of space for footnotes.

I would suggest going to a website which has these "webtabs" and viewing the source code therein (right click/view source) or save the page and open in a html editor.  I would suggest that, and not tested this, that it should be straight forward in setting a bit of code in a data step between output procs, e.g.

data tabcode;

     code="<htab start ref='ABC'>"; output;

     code="<title>A Title</title>"; output;

     code="</htab>"; output;

run;

proc print data=tabcode nobs;

run;

proc report data=x;

run;

data tabcode;

     code="<htab start ref='BCD'>"; output;

     code="<title>A Title Two</title>"; output;

     code="</htab>"; output;

run;

proc print data=tabcode nobs;

run;

proc summary data=x;

run;

Etc.

You can pretty much build any kind of webpage that way as long as you know the HTML for it.

Super User
Posts: 9,867

Re: ODS HTML Footnote with HREF

How about this :

ods listing close;
ods escapechar='~';
ods html style=default path="c:\temp\" (url=none) body='ch8_5_3b.html';
footnote1 '~S={url="ch8_5_3b.html#PROC MEANS"} PROC MEANS';
footnote2 '~S={url="ch8_5_3b.html#PROC FREQ"} PROC FREQ';

proc report data=sashelp.prdsale
(where=(prodtype='OFFICE'))
nowd;
column region product,actual;
define region / group ;
define product / across;
define actual / analysis sum;
rbreak after / summarize;
run;
ods html anchor='PROC MEANS';
proc means data=sashelp.class n mean;
class sex;
var age;
run;
ods html anchor='PROC FREQ';
proc freq data=sashelp.class ;
tables sex*age;
run;
ods html close;
ods listing close;

Xia Keshan

Ask a Question
Discussion stats
  • 2 replies
  • 499 views
  • 0 likes
  • 3 in conversation