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

My code that doesn't work is placing page headers and footers (company, page, program, date) inside the plot instead of on page top and bottom  margin spaces.  How can I fix it?  Thank you in advance!   
My code:

 

** Page Headers and Footers;

title1 j=left font='Arial' 'Company' j=right "Page ~{pageof}";

title2 j=left font='Arial' 'Protocol';

footnote1 j=left font='Arial' 'Program: myprogram.sas' j=right "Date Produced: date";

footnote2 j=right font='Arial' "Date of Data Cut: date";

 


*** Box and Whisker plot ***;

 

options formchar="|____|+|___+=|_/\<>*" pageno=1 nonumber nodate orientation=landscape center;

ods listing close;

ods rtf file="&path.\myplot.rtf" style=journal ;

ods escapechar='~';

ods listing image_dpi=200;

%let margin=%sysfunc(cats(%eval((100-30)/2),%));

ods rtf text="~S={leftmargin=&margin. rightmargin=&margin. just=center font=('Arial',9.5pt,bold italic)} Figure 1. Distribution of TBR";

proc sgplot data=lsn_plt noborder;

vbox lsn_avg / category=dose;

yaxis label="TBR" grid;

xaxis label="Dose (mg)";

run;

%let margin=%sysfunc(cats(%eval((100-60)/2),%));

ods rtf text="~S={leftmargin=&margin. rightmargin=&margin. just=l font=('Arial', 9pt)}Notes:

~n Tukey box and whisker plot.";

ods rtf close;

ods listing;

 

 

The output is in the attached file

 

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Specify NOGTITLE and NOGFOOTNOTE on the ODS RTF statement, and see if that gives you what you want.

 

Hope this helps!

Dan

View solution in original post

4 REPLIES 4
JeffMeyers
Barite | Level 11

Hello,

   I don't see a straightforward option for this within the ODS GRAPHICS statement or the SGPLOT procedure statement, but I have an idea.  The procedures like SGPLOT and SGPANEL automatically pull in the title and footnotes, but SGRENDER doesn't.  You could output your SGPLOT code to use GTL instead and use SGRENDER to make your plot.  This should leave your titles/footnotes in your document.   You can use the TMPLOUT option within the SGPLOT statement to have it create the GTL code for you (you'd have to manually copy and paste the code from the output program back into your original program).  You might have to remove ENTRYTITLE and ENTRYFOOTNOTE statements if you have active titles/footnotes when you run SGPLOT.

 

TMPLOUT=“filename

writes the Graph Template Language code for your graph to a file. Writing your template code to a file can be useful for building larger Graph Template Language definitions.

RestrictionGraphs that contain summarized data (for example, bar, line, and dot) do not generate a useable template. For summarized data, the procedure sets internal values for one or more variables, and these internal values do not exist in the data set that is used with the procedure.
numbergirl
Obsidian | Level 7

Thanks for your reply, Jeff.   I didn't catch all of that, but it reminds me, I don't think there is a need for the options listed in the reply below when rendering a plot template.

Helena

DanH_sas
SAS Super FREQ

Specify NOGTITLE and NOGFOOTNOTE on the ODS RTF statement, and see if that gives you what you want.

 

Hope this helps!

Dan

numbergirl
Obsidian | Level 7

Thanks for your reply, Dan.   It worked!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 4 replies
  • 1914 views
  • 3 likes
  • 3 in conversation