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.

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: 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.

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: 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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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
  • 590 views
  • 3 likes
  • 2 in conversation