BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
smackerz1988
Pyrite | Level 9

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  

smackerz1988_0-1705695036256.png

But I want the titles and footnotes outside of the image similar to the rundate on the top right. Where is it going wrong? 

1 ACCEPTED SOLUTION

Accepted Solutions
Quentin
Super User

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.

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.

View solution in original post

2 REPLIES 2
Quentin
Super User

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.

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
smackerz1988
Pyrite | Level 9

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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1019 views
  • 3 likes
  • 2 in conversation