I'have some problem in rtf contents. My question is :
I want to control the pagebreak by generating a variable of "_pageno" and using proc report to output the listing to rtf, here is my code.
data class;
set sashelp.class;
if _N_ <=5 then _pageno = 1;
else if _N_ <=10 then _pageno = 2;
else if _N_ <=15 then _pageno = 3;
else if _N_ <=20 then _pageno = 4;
run;
%macro report();
%do i = 1 %to 4;
Title "This is Table Title";
proc report data=class (where=( _pageno = &i.)) nowd split='|' ;
run;
%end;
%mend report;
%let path = C:\Users\Administrator\Desktop\test;
ods html close;
options missing = "" nodate nonumber orientation =landscape ls=200 center papersize=A4 ;
title;footnote;
ods escapechar='`';
ods tagsets.rtf path = "&path" file="class.rtf" style=tagsetsrtf
options(contents='yes' toc_data='on' continue_tag='off' toc_level = '1' vspace='off' );
ods proclabel "This is Table of Contents" ;
%report;
ods tagsets.rtf close;
ods html;here if my result, i dont need the "Report PROCEDURE" displayed in the comtents.
Is there a method to supress the "Report PROCEDURE"?
Taking inspiration from:
Example 1: "Creating a Table of Contents" | SAS Help Center: ODS TAGSETS.RTF Statement
I made this change to the Macro report()
%macro report();
%let i=1;
proc report data=class (where=( _pageno = &i.)) nowd split='|' ; run;
%do i = 2 %to 4;
ods tagsets.rtf options(toc_data='no');
Title "This is Table Title";
proc report data=class (where=( _pageno = &i.)) nowd split='|' ; run;
%end;
%mend report;
This left justifies the tables 2 through 4 for me... IDK why? Hopefully that's something you can apply code to.
Taking inspiration from:
Example 1: "Creating a Table of Contents" | SAS Help Center: ODS TAGSETS.RTF Statement
I made this change to the Macro report()
%macro report();
%let i=1;
proc report data=class (where=( _pageno = &i.)) nowd split='|' ; run;
%do i = 2 %to 4;
ods tagsets.rtf options(toc_data='no');
Title "This is Table Title";
proc report data=class (where=( _pageno = &i.)) nowd split='|' ; run;
%end;
%mend report;
This left justifies the tables 2 through 4 for me... IDK why? Hopefully that's something you can apply code to.
Thank you very much.
My problem has been resolved perfectly by you codes. A small adjustments to you code. like this.
%macro report();
%let i=1;
Title "This is Table Title";
proc report data=class (where=( _pageno = &i.)) nowd split='|' ; run;
%do i = 2 %to 4;
ods tagsets.rtf options(toc_data='no');
Title "This is Table Title";
proc report data=class (where=( _pageno = &i.)) nowd split='|' ; run;
%end;
%mend report;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.