The SAS Output Delivery System and reporting techniques

ODS/PROC DOCUMENT: Differences between PDF and RTF outputs

Posts: 23

ODS/PROC DOCUMENT: Differences between PDF and RTF outputs

[ Edited ]

Hi everyone, 


I've been working on some reports and using ODS/PROC DOCUMENT to output some tables/figures into a PDF or RTF document. Firstly, I've used PROC REPORT to generate a table and save it as a item store with ODS DOCUMENT:


ods document name=work.istore(write);

ods escapechar="^";
*options ls=155 ps=70 orientation=landscape;
options nodate nonumber orientation=landscape;

/* Title & Footnote */
title "Enrollment report for XYZ trial to %sysfunc(intnx(day,&end_date.,0),date11.)";

/* Apple Header, Line, and Column Styles in PROC REPORT Statement */
proc report data=EnrollmentReport nowd center split="|" missing contents="Enrollment report for XYZ trial"
	style(header)=[just=c font_weight=bold asis=on font_size=9pt]
	style(lines)=[just=l font_size=9pt]
	style(column)=[just=c cellwidth=1.8cm font_size=9pt];

/* Add Bottom Cell Borders and Create A Spanning Header */
	columns ("^{style [borderbottomwidth=1pt]}" flag site start_date ("^{style [borderbottomwidth=1pt] Enrollment}" middle &time.1-&&time.&ntime.) total_&time. total_enr real_average_&time. expected_average_&time. site_target enr_need);

	*define flag / order order=data noprint;
	define flag / group noprint;
	define site / order order=data style(column)=[just=l cellwidth=4cm];
	define middle / order order=data style(column)=[cellwidth=1.5cm];
	define &time.1-&&time.&ntime. / order order=data style(column)=[cellwidth=1.3cm];

	break before flag / page contents="";

/* Summarize Enrollment Data Above Page */
	compute before _page_ / style={just=l};
		length text: $200;
		text1 = "Data: &start_date_label. - &data_end.";
		text2 = "Total enrollment: &total_enr." || "    " || "Protocol target: &protocol_target." || "    " || "Enrollment needed: &enr_need.";
		text3 = "Number of &time.s: &&total_&time." || "    " || "Average per &time.: &&real_average_&time.";
		text4 = "Assumption for computation of target enrollment: End of recruitment period March 31st, 2018";
		line " ";
		line text1 $200.;
		line text2 $200.;
		line text3 $200.;
		line text4 $200.;

ods document close;
/* Close ODS DOCUMENT */


And then, using PROC DOCUMENT to output the result:


/* Rearrange item stores */
proc document;
	/* Table */
	copy \work.istore\Report#1 to ^;
	setlabel Report#1 "Enrollment report";

	*list / levels=all;

/* Output by PROC DOCUMENT */
ods pdf file=&url. style=MyStyle pdftoc=2;
proc document;
	replay Report#1;


But I noticed a few differences when comparing 2 outputs in PDF and RTF:

  1. The spanning headers above and under "Enrollment" disappeared in the PDF output.
  2. I had a warning for the "bodytitle" option for RTF output if I included other tables/figures into the document.
  3. That question might need its own thread: when update/activate the "Tables of Contents" in RTF output (CTRL+F9), I don't know why the TOC used "Courrier New" font while the whole document is in "Times New Roman". MyStyle is slightly modified version of "Journal" style by using "Times New Roman" as its only font. 

I'd appreciate it if someone could help me with these questions.

Thanks in advance !!!

Ask a Question
Discussion stats
  • 0 replies
  • 1 in conversation