BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
data_null__
Jade | Level 19

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_

1 ACCEPTED SOLUTION

Accepted Solutions
GraphGuy
Meteorite | Level 14

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

9 REPLIES 9
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.?

data_null__
Jade | Level 19

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

GraphGuy
Meteorite | Level 14

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

DanH_sas
SAS Super FREQ

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

GraphGuy
Meteorite | Level 14

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;

data_null__
Jade | Level 19

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

MartinMincey
SAS Employee

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

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

djrisks
Barite | Level 11

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;

eshupp
Obsidian | Level 7

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.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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