BookmarkSubscribeRSS Feed
StephenM
Fluorite | Level 6

 

I'm running into a weird problem whilst using page breaks in proc report. Whenever I try break introduce page breaks for a grouping variable the first title for the page with that grouping appear differently from the rest; they appear slightly bold. This causes problem for us when we try to process the pdf in a pdf editor because apparently each title is being printed twice.

 

I have some code to demonstrate. Here is some test data with the same structure of the data I am trying to output.

 

 

data testdata;
do group_var1 = 1 to 4; do group_var2 = 1 to 30; do across_var1 = 1 to 10; result = 1; output; end; end; end; run;

 

The aim is to tabulate this data in such a way that multiple group_var1 groups do not appear on the same page. Whenever I split the page using by groups or a break variable I get the problem. If I don't split the page the problem doesn't appear, but then the data isn't being displayed correctly. I have code below which produces the three examples above.

 

options orientation=landscape nodate nonumber PAPERSIZE = A4 nobyline;
ods escapechar = "^";

ods pdf file = "path_to_dir\test_output_1_by_group.pdf";

	Title1 "Title 1";
	Title2 "Title 2";
	Footnote1 "Footnote 1";
	Footnote2 "Footnote 2";
	FOOTNOTE3 "^{thispage} / ^{lastpage}";

	proc report data = testdata;
		by group_var1;
		column group_var1 group_var2 across_var1, result;
		define group_var1 / group;
		define group_var2 / group;
		define across_var1 / across;
	run;

ods pdf close;

ods pdf file = "path_to_dir\test_output_2_page_breaks.pdf";

	Title1 "Title 1";
	Title2 "Title 2";
	Footnote1 "Footnote 1";
	Footnote2 "Footnote 2";
	FOOTNOTE3 "^{thispage} / ^{lastpage}";

	proc report data = testdata;
		column group_var1 group_var2 across_var1, result;

		define group_var1 / group;
		define group_var2 / group;
		define across_var1 / across;
break after group_var1 / page; run; ods pdf close; ods pdf file = "path_to_dir\test_output_3_none.pdf"; Title1 "Title 1"; Title2 "Title 2"; Footnote1 "Footnote 1"; Footnote2 "Footnote 2"; proc report data = testdata; column group_var1 group_var2 across_var1, result; define group_var1 / group; define group_var2 / group; define across_var1 / across; run; ods pdf close;

I have attached the pdfs which the above code reproduces. You should see for test_output 1 and 2 that whenever a new group_var1 value starts (odd pages) then the titles and footnotes appear different to the rest.

 

I am using SAS 9.4 and on Windows 7. If anyone can help resolve this issue for me it would be much appreciated.

 

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, you haven't supplied a style, so its using a default.  You may want to check what the style states as that defines the output format.  

http://www2.sas.com/proceedings/sugi30/132-30.pdf

 

Its likely that in the style it is defaulting to this is the given behavior as it seems consistent.  

 

data_null__
Jade | Level 19

Interesting when I edit the PDF and cut the text of the footnote it still appears until I cut it again.  The text appears to be overplayed.  I don't know how to fix it and I haven't found anything about this at support.sas.com

StephenM
Fluorite | Level 6

That is exactly what we found. This causes problems for us because (in addition to being inconsistent visually) we use the titles to automatically generate bookmarks and having multiple titles overlayed on top of each other causes problems. I just took another look at the pdfs with an online pdf editor and found that problem remains for the footnotes when not using page breaks but gets fixed for the titles

 

Thanks for the style suggestion RW9. We normally use a custom style but I removed it in the example for the sake of keeping the code simple and trying to isolate the problem. I tested again whilst including the style just to make sure and the problem still remains.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, I have to say that I have yet to be impressed with SAS->PDF in any sense, TOC, bookmarks etc.  Hence why I output my outputs to RTF, batch convert them, then use PDFtk to extract and apply bookmarks.  Much more controllable.

Cynthia_sas
SAS Super FREQ
Hi:
This is the kind of issue that you need to report to Tech Support. You have code that illustrates the issue. It really appears as though your custom style is not relevant in this instance. Tech Support can look for any defects related to titles and if they don't find any, but they can replicate your issue, then they can involve the developers.

Cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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