BookmarkSubscribeRSS Feed
JohnChen_TW
Quartz | Level 8

Hi everyone,

I'm using SAS9.3.

I have no idea why the 'Note' at the end of table cannot be presented on every single page when the total page of tale is more than 1.

(In some tables, it is only presented on the last page. Why?)

 

 

Here is my partial code:

proc template...;
...
replace Table from Output / frame=above;
...
end;
run;

And I put "Note: xxx" using:

compute after _page_/style={just=l font_face='Arial' font_size=10pt bordertopcolor=black bordertopwidth=0.25};
line "Note:";
line "The unit of age is year";
endcomp;

 Here is ODS destination I'm using: (I need both RTF and PDF)

PROC REPORT;
...
...
...
RUN;

ODS RTF file="xxxxx.rtf"  style=xxxxx ;  
ODS PRINTER PDF file="xxxxx.pdf"  style=xxxxx replay; run;
ODS PRINTER PDF PDF CLOSE;
ODS RTF CLOSE;
19 REPLIES 19
Reeza
Super User

What output destination are you using? The concept of what's a PAGE boundary varies, HTML doesn't have boundaries. 

FOOTNOTES text do repeat at the end of each page for a table that crosses over page boundaries.

 

http://www2.sas.com/proceedings/forum2008/031-2008.pdf

 

There's a note (pg 14) in paper above about this not working as expected in RTF docs.

 

JohnChen_TW
Quartz | Level 8

HI @Reeza

I'm sorry, I do not know what OUTPUT destination is...

example1.png

Like the graph above, I'd like to show 'Note: *The unit of age is year' on each page.

Yes, FOOTNOTES can repeat at the end of each page for a table, but I need to print the Note above following the bottom border line, not at the footer.

In some tables which were printed by the same code, "Note:xxxx" can be printed on each page.

But in other tables, it was printed on the only last few pages. Why?

 

JC

Reeza
Super User

Because different outputs (PDF, RTF, HTML) have different definitions of what a 'page' is. 

The paper goes into more detail and you can probably search at Lexjansen, but the workaround does appear to use a footnote.

JohnChen_TW
Quartz | Level 8

I'm using ODS RTF to output the report and using ODS PRINTER PDF to print the report in PDF.

I mean there are several tables (Table 1, 2, ...etc) included in one file (RFT or PDF), but "Note:xxx" cannot be shown on each page of all tables.
For example, I got the file named have.pdf (or rft) which is including 5 tables and each of table has three pages.

However, when I was using

option nodate nonumber papersize=A4 topmargin="0.75in";
ods escapechar='^';
ods document name=WORK.CONTENTS(write);
title1 j=left "NAME";
footnote1 j=left "PATH://";

PROC REPORT DATA=Table1;
...
...
...
compute after _page_/style={just=l font_face='Arial' font_size=10pt bordertopcolor=black bordertopwidth=0.25};
line "Note:";
line "The unit of age is year";
endcomp;
RUN;

ODS RTF file="Table1.rtf"  style=xxxxx ;  
ODS PRINTER PDF file="Table1.pdf"  style=xxxxx replay; run;
ODS PRINTER PDF PDF CLOSE;
ODS RTF CLOSE;
/*********************************************************************************/

option nodate nonumber papersize=A4 topmargin="0.75in";
ods escapechar='^';
ods document name=WORK.CONTENTS(write);
title1 j=left "NAME";
footnote1 j=left "PATH://";

PROC REPORT DATA=Table2;
...
...
...
compute after _page_/style={just=l font_face='Arial' font_size=10pt bordertopcolor=black bordertopwidth=0.25};
line "Note:";
line "The unit of age is year";
endcomp;
RUN;

ODS RTF file="Table2.rtf"  style=xxxxx ;  
ODS PRINTER PDF file="Table2.pdf"  style=xxxxx replay; run;
ODS PRINTER PDF PDF CLOSE;
ODS RTF CLOSE;
/*********************************************************************************/

option nodate nonumber papersize=A4 topmargin="0.75in";
ods escapechar='^';
ods document name=WORK.CONTENTS(write);
title1 j=left "NAME";
footnote1 j=left "PATH://";

PROC REPORT DATA=Table3;
...
...
...
compute after _page_/style={just=l font_face='Arial' font_size=10pt bordertopcolor=black bordertopwidth=0.25};
line "Note:";
line "The unit of age is year";
endcomp;
RUN;

ODS RTF file="Table3.rtf"  style=xxxxx ;  
ODS PRINTER PDF file="Table3.pdf"  style=xxxxx replay; run;
ODS PRINTER PDF PDF CLOSE;
ODS RTF CLOSE;
/*********************************************************************************/

option nodate nonumber papersize=A4 topmargin="0.75in";
ods escapechar='^';
ods document name=WORK.CONTENTS(write);
title1 j=left "NAME";
footnote1 j=left "PATH://";

PROC REPORT DATA=Table4;
...
...
...
compute after _page_/style={just=l font_face='Arial' font_size=10pt bordertopcolor=black bordertopwidth=0.25};
line "Note:";
line "The unit of age is year";
endcomp;
RUN;

ODS RTF file="Table4.rtf"  style=xxxxx ;  
ODS PRINTER PDF file="Table4.pdf"  style=xxxxx replay; run;
ODS PRINTER PDF PDF CLOSE;
ODS RTF CLOSE;
/*********************************************************************************/

option nodate nonumber papersize=A4 topmargin="0.75in";
ods escapechar='^';
ods document name=WORK.CONTENTS(write);
title1 j=left "NAME";
footnote1 j=left "PATH://";

PROC REPORT DATA=Table5;
...
...
...
compute after _page_/style={just=l font_face='Arial' font_size=10pt bordertopcolor=black bordertopwidth=0.25};
line "Note:";
line "The unit of age is year";
endcomp;
RUN;

ODS RTF file="Table5.rtf"  style=xxxxx ;  
ODS PRINTER PDF file="Table5.pdf"  style=xxxxx replay; run;
ODS PRINTER PDF PDF CLOSE;
ODS RTF CLOSE;

assume that the "Note:xxx" can be shown on each page in Table1, 3, 4, but only can be shown on the last page in Table 2 and 5.

 

I'd like to know why did it happen, and how to resolve this problem.

 

JC

Reeza
Super User

I think this is beyond me, especially at this time. 

I would suggest posting the log and your exact SAS version as well, ie SAS 9.3TS2M1

JohnChen_TW
Quartz | Level 8

I found the common point in these tables where the "Note:xxx" cannot be shown on each page is that the footnote would be printed in BOLD on the first page of the table (e.g.: Page 1 of xx), but printed normality on the following pages.
Maybe it's the key to the problem?

 

BTW, I do not know how to find the exact version of SAS...

JC

Cynthia_sas
SAS Super FREQ

Hi:

  To find the exact version of SAS that you're running, submit this code:

 

%put -----> version is &sysvlong4;

 

  Which on my system, results in this:

sysvlong4_put.png

 

That shows you the exact version of SAS you are using...in the above case, 9.4 maintenance release M3.

 

cynthia

JohnChen_TW
Quartz | Level 8

Hi @Cynthia_sas and @Reeza,

My SAS version is,

SASversion.PNG

 

JC

Reeza
Super User

If you still need assistance with this I suggest Tech Support. We don't have enough information to test it - ie no code with data to replicate the issue. Plus the version of SAS you're using is fairly old, so Tech Support may have access to it but most of the other users will not. 

 

JohnChen_TW
Quartz | Level 8
Hi @Cynthia_sas,
My SAS version is 9.03.01M2P08152012.
Do you have any suggestion?

I still have no idea how to show the NOTE on each page in one table by ODS RTF. (above)

JC
Cynthia_sas
SAS Super FREQ

Hi:

  It is impossible to run your code because you haven't provided everything. I no longer have 9.3 to test with, but this is the output I get with some fake data created from SASHELP.CLASS so my final output will have 4 pages -- with 1 "name" on every page. Here's the output -- as you see, I get the NOTE from the COMPUTE block on every page (I changed your code slightly to make the note red, so it would be clearly visible on every page, even at a reduced size):

get_note_every_page.png

 

 

  Here's the code I used:

** make some fake data;
** use BIGGROUP for paging;
** will have 1 page of 25 obs for each name;
data bigclass;
  set sashelp.class(obs=4);
  biggroup = _n_;
  do i = 1 to 25;
    output;
  end;
run;
 
** sort;
proc sort data=bigclass;
  by biggroup name;
run;
   
** use PROC REPORT and ODS RTF to get 1 page for every BIGGROUP value;
** will have 4 pages. Should see note on every page, underneath table;
    
** use ODS DOCUMENT to capture PROC REPORT output;
         
ods document name=work.testdoc;
ods rtf file='c:\temp\bigclass1.rtf';
proc  report data=bigclass;
  column biggroup name age height weight sex;
  define biggroup / order page;
  define name / display;
  break after biggroup / page;
  compute after _page_/
          style={just=l font_face='Arial' font_size=10pt color=red fontweight=bold};
      line "Note:";
      line "The unit of age is year";
  endcomp;
RUN;
ods rtf close;
  
ods document close;
  
** now replay the saved document output; 
ods rtf file='c:\temp\replaydoc.rtf';
ods pdf file='c:\temp\replaydoc.pdf';
   
proc document name=work.testdoc;
replay;
run;
quit;
  
ods _all_ close;

 

 Since you didn't show your ODS DOCUMENT and since you didn't really explain why you had ODS RTF and ODS PRINTER PDF statements, I only experimented with ODS RTF in my test code. However, I do get the NOTE output at the bottom of each page.

 

  But I used ODS DOCUMENT to save the PROC REPORT output to a document store and then did a replay to RTF and PDF and again, the NOTE from the COMPUTE block appeared on every page.

 

  So I think that Reeza's suggestion is probably a good one -- to work with Tech Support. They can look at ALL of your code and ALL of your data and they have 9.3 available for testing -- so they can help you best.

 

  However, you could try to run my test code and if your results are the same as my results, then my suggestion would be for you to revisit your code using my test code as the model and see whether you can debug your way to a solution.

 

cynthia

 

JohnChen_TW
Quartz | Level 8

Hi @Cynthia_sas,

Sorry, I do not know much about "PROC REPORT"...

Here are a fake data and output.

data have; length sno group name sex res ans $200;
infile cards dlm=',';
input sno group name sex res ans;
cards;
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 1	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 2	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 2	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 2	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 2	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 2	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	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xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 5	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 5	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 5	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 5	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 5	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 5	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 5	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 5	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 5	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 5	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 5	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 5	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 6	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 6	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 6	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 6	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 6	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,   xxx
2	,	Gorup 6	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 6	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 6	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 7	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Group 8	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Group 9	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 10	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 10	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 10	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 10	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 10	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
2	,	Gorup 10	,	xxxxxxxxxxxxx	,	Female	,	xxxxx	,	xxx
;
run;

options nodate nonumber papersize=A4 topmargin="0.75in" missing=' '; 
ods escapechar='^';
ods document name=work.testdoc(write);
ods rtf file="&outpath\test.rtf";
PROC REPORT DATA=have NOWD
	center                
	headskip
	split='|' 
	ls=256;
	title1 j=r "Page ^{thispage} of ^{lastpage}";
	title5 j=c "Example";
	title6	j=c "Proc Report";
	footnote1 j=l "footnote";
    columns sno group name sex res ans;
	define sno	 					/center	style=[cellwidth=20mm]   	'Subject ID';
	define group 		 			/center	style=[cellwidth=45mm]   	'Test Group';
	define name					/left		style=[cellwidth=60mm]   	'Test Name';
	define sex  					/center	style=[cellwidth=15mm]   	'Gender';
	define res 						/center	style=[cellwidth=40mm]   	'Result';
	define ans  					/center	style=[cellwidth=25mm]   	'Yes/ No';
	compute after _page_/style={just=l font_face='Arial' font_size=9pt borderbottomcolor=white};
		line "Note:";
		line "Why the note cannot be displayed on each page...?";
	endcomp;
RUN;
ods rtf close;
ods document close;
ods rtf file="&outpath\test.rtf" sectiondata='\headery540\footery540' style=Styles.mystyle;
ods pdf file="&outpath\test.pdf" style=Styles.mystyle;
proc document name=work.testdoc;
replay;
run;
quit;

ods _all_ close;

The note is displayed only on the last two pages.

 

JC

MINX
Obsidian | Level 7

Hi @JohnChen_TW

 

I think you did not page break your table. Although table is displayed in multiples pages, SAS consider this is still one page if you did not use 'break after pagebreak_variable/page' or BY statement in PROC REPORT. That is why you only see the note is only displayed at the last page.

JohnChen_TW
Quartz | Level 8

HI @MINX,

Thanks for your input.

This is a weird issue because the note is not always displayed only at the last page, in some tables, the note could be displayed at the bottom of each page based on the same code.

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
  • 19 replies
  • 2558 views
  • 0 likes
  • 4 in conversation