Hello,
I'm having an issue with titles and footnotes in a macro I developed using CDISC PILOT Study Data
/* Open ODS destination based on specified output type and path */
%if (%upcase(&output_type) = PDF) and (&output_path ne ) %then %do;
ods escapechar='~';
ods pdf file="&outpath./&outname..pdf"
image_dpi = 300;
%end;
%else %if (%upcase(&output_type) = RTF) and (&output_path ne ) %then %do;
ods escapechar='~';
ods rtf file = "&outpath./&outname..rtf"
image_dpi = 300;
%end;
/* Close ODS destination */
%if %upcase(&output_type) = PDF %then %do;
ods pdf close;
%end;
%else %if %upcase(&output_type) = RTF %then %do;
ods rtf close;
%end;
When I run this code I get this output
But I want the titles and footnotes outside of the image similar to the rundate on the top right. Where is it going wrong?
On your ODS PDF and ODS RTF statements, you can add the options nogtitle and nogfootnote. That will tell SGPLOT to add the titles outside of the graph image. It basically makes them titles for the page, instead of a title within the graph area. As an example:
ods pdf file="Q:\junk\foo.pdf" nogtitle ;
title "hello" ;
proc sgplot data=sashelp.class ;
scatter x=height y=weight ;
run ;
title;
ods pdf close ;
As a side note, when posting a question, it's helpful to post a small example of your problem. In this case, since your question is not really about macros, it would be clearer to show a little example focused on the positions of titles and footnotes.
On your ODS PDF and ODS RTF statements, you can add the options nogtitle and nogfootnote. That will tell SGPLOT to add the titles outside of the graph image. It basically makes them titles for the page, instead of a title within the graph area. As an example:
ods pdf file="Q:\junk\foo.pdf" nogtitle ;
title "hello" ;
proc sgplot data=sashelp.class ;
scatter x=height y=weight ;
run ;
title;
ods pdf close ;
As a side note, when posting a question, it's helpful to post a small example of your problem. In this case, since your question is not really about macros, it would be clearer to show a little example focused on the positions of titles and footnotes.
Perfect thanks very much @Quentin nogfootnote nogtitle worked great!. Yes, I will be more specific about the exact root of my issue next time. Appreciate your time!.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.