Data visualization with SAS programming

SG: ODS RTF BODYTITLE #BYVAL in FOOTNOTE statement.

Accepted Solution Solved
Reply
Respected Advisor
Posts: 3,790
Accepted Solution

SG: ODS RTF BODYTITLE #BYVAL in FOOTNOTE statement.

Is there any way to make this work?  The BYVAL in the footnote is for the next by group.

Edit: It turns out that it does not work with options "bodytitle nogtitle nogfootnote" the options I need to use.

proc sort data=sashelp.class out=class;
   by sex;
   run;
ods rtf file="~/test.rtf" bodytitle nogtitle nogfootnote;
proc sgplot;
  
by sex;
   scatter x=age y=height;
   title '#byval(sex)';
  
footnote '#byval(sex)';
  
run;
ods rtf close;


11-20-2014 8-42-55 AM.png

Message was edited by: data _null_


Accepted Solutions
Solution
‎11-21-2014 08:17 AM
SAS Employee
Posts: 980

Re: SG: ODS RTF BODYTITLE #BYVAL in FOOTNOTE statement.

I checked with the developers, and they say this is a problem that can't be fixed.

As a work-around, I would suggest using gplot with gtitles & gfootnotes ...

proc sort data=sashelp.class out=class;

   by sex;

   run;

ods rtf /*file="~/test.rtf"*/ bodytitle gtitle gfootnote;

proc gplot data=class;

   by sex;

   plot height*age;

   title '#byval(sex)';

   footnote '#byval(sex)';

   run;

ods rtf close;

gfootnote.png

View solution in original post


All Replies
Super User
Super User
Posts: 7,727

Re: SG: ODS RTF BODYTITLE #BYVAL in FOOTNOTE statement.

Not sure what version you are using but on my 9.3 install I don't even get the M or F in the footnote - byval is not actioned at all.  I presume you don't want workarounds such as looping etc.?

Respected Advisor
Posts: 3,790

Re: SG: ODS RTF BODYTITLE #BYVAL in FOOTNOTE statement.

I'm working on the workaround I was hoping for easy. :smileyshocked:

Solution
‎11-21-2014 08:17 AM
SAS Employee
Posts: 980

Re: SG: ODS RTF BODYTITLE #BYVAL in FOOTNOTE statement.

I checked with the developers, and they say this is a problem that can't be fixed.

As a work-around, I would suggest using gplot with gtitles & gfootnotes ...

proc sort data=sashelp.class out=class;

   by sex;

   run;

ods rtf /*file="~/test.rtf"*/ bodytitle gtitle gfootnote;

proc gplot data=class;

   by sex;

   plot height*age;

   title '#byval(sex)';

   footnote '#byval(sex)';

   run;

ods rtf close;

gfootnote.png

SAS Super FREQ
Posts: 925

Re: SG: ODS RTF BODYTITLE #BYVAL in FOOTNOTE statement.

Actually, you existing SGPLOT will work fine with GTITLE/GFOOTNOTE as well.

SAS Employee
Posts: 980

Re: SG: ODS RTF BODYTITLE #BYVAL in FOOTNOTE statement.

I can also reproduce the problem you're seeing with sgplot at 9.4.

You might need to use gplot (with gtitle & gfootnote) instead ...

proc sort data=sashelp.class out=class;

   by sex;

   run;

proc gplot;

   by sex;

   plot height*age;

   title '#byval(sex)';

   footnote '#byval(sex)';

   run;

Respected Advisor
Posts: 3,790

Re: SG: ODS RTF BODYTITLE #BYVAL in FOOTNOTE statement.

I only have 9.3 and even with GPLOT I still get the same bad result for RTF destination.

SAS Employee
Posts: 3

Re: SG: ODS RTF BODYTITLE #BYVAL in FOOTNOTE statement.

You can also try removing the BODYTITLE option from the ODS RTF statement, such as:

ods rtf file="~/test.rtf" nogtitle nogfootnote;

Super Contributor
Posts: 252

Re: SG: ODS RTF BODYTITLE #BYVAL in FOOTNOTE statement.

Another option is to use GTL with the Entrytitle and Entryfootnote statement.


proc sort data=sashelp.class out=class;
  by sex;
run;

/*---------------------------------------------------------------------*/
/*      Using Entrytitle and Entryfootnote                       */
/*---------------------------------------------------------------------*/


goptions reset = all;


proc template;
  define statgraph newplot;
    dynamic _byval_;
    begingraph;
   entrytitle _byval_;
   entryfootnote _byval_;
   layout overlay;
     scatterplot x = age y = height;
   endlayout;
endgraph;
  end;
run;


ods rtf file="test3.rtf" nogtitle nogfootnote;
proc sgrender data = class template = newplot;
  by sex;
run;
ods rtf close;

New Contributor
Posts: 3

Re: SG: ODS RTF BODYTITLE #BYVAL in FOOTNOTE statement.

I am actually having the same problem with ODS HTML output from SGPLOT and i just stumbled on this thread.  i am using NOGTITLE with #BYVAL  and LINK to be able to jump from a chart to a tabular report of the same data.  it worked great under 9.3 but the day we migrated to 9.4 (this is z/OS by the way) the #BYVAL started displaying the next by value rather than the current.  if you run the same code with GFOOTNOTE the value is correct but the hyperlink does not work.  I have submitted a tracks since this absolutely worked correctly under 9.3 and broke with 9.4 so I don't think the response above that "I checked with the developers, and they say this is a problem that can't be fixed" is correct.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 9 replies
  • 897 views
  • 0 likes
  • 7 in conversation