BookmarkSubscribeRSS Feed
SASUserMD
Obsidian | Level 7

Hello,

 

I use ods rtf text to set the TOCs for the table of contents. Now I got a problem with PROC REPORT when I use the ID statement and the page option to insert a page break. As you can see in the following example: For price 1 to 6 there is only a heading on the first page while price 7 to 12 and price 13 to 16 has a heading on each page. When you now delete the ods rtf text, there will be a heading on each page. Can you help me to fix this problem? Why has PROC REPORT a problem with ods rtf text?

 

 

ods rtf startpage=yes;

PROC TABULATE DATA=sashelp.pricedata;
	class regionName;
	table regionName , N;
RUN;

ods rtf startpage=now;
ods rtf text="\\TOC ...";

PROC REPORT DATA=sashelp.pricedata(obs=60);
	columns regionName price1 - price16;
	define regionName / display id;

	define price7 / page;
	define price13 / page;
RUN;

ods rtf close;

Thanks for your comments.

 

3 REPLIES 3
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

@SASUserMD should this


 
define price7 / page;
define price13 / page;

be this


 define price1 / page;
define price6 / page;

SASUserMD
Obsidian | Level 7

No, I want a page break before price 7 and 13. But the real problem is the heading. Why is there no heading on the second page after PROC REPORT only - see attachment.

Cynthia_sas
Diamond | Level 26

Hi:
I suggest you review this paper https://support.sas.com/resources/papers/proceedings14/SAS038-2014.pdf especially the section titled "What if my Output is Too Wide" that starts on page 12 -- we have an example that shows the headers do not repeat on the "overflow" page. I believe you'll have to try some of the techniques we outline in the paper. Also, I recommend getting the page breaks and headers working as you want before worrying about the TOC. Also, between ODS PROCLABEL statement and CONTENTS= inside PROC REPORT, I don't typically find the need to use ODS TEXT to alter what appears in the TOC.


Cynthia

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1401 views
  • 0 likes
  • 3 in conversation