BookmarkSubscribeRSS Feed
Ajay05
Calcite | Level 5

Hi All,

 

Greetings for the day!

 

In the below dummy data i am try to produce a lab shift RTF output using preloadfmt option in proc report. But dont know why its causing lots of blank rows.

 

The dummy data:

TRT01ANAVISITNAVISITBAVALNBCNTAVALNPCT
11Day 1140129 (72.5)
11Day 1140211 (27.5)
11Day 121514 (26.7)
11Day 1215211 (73.3)
12Day 2137130 (81.1)
12Day 213727 (18.9)
12Day 221412 (14.3)
12Day 2214212 (85.7)
13Day 3135125 (71.4)
13Day 3135210 (28.6)
13Day 321314 (30.8)
13Day 321329 (69.2)
21Day 1139135 (89.7)
21Day 113924 (10.3)
21Day 122318 (34.8)
21Day 1223215 (65.2)
22Day 2136132 (88.9)
22Day 213624 (11.1)
22Day 222317 (30.4)
22Day 2223216 (69.6)
23Day 3134131 (91.2)
23Day 313423 (8.8)
23Day 322317 (30.4)
23Day 3223216 (69.6)
31Day 1131125 (80.6)
31Day 113126 (19.4)
31Day 1228111 (39.3)
31Day 1228217 (60.7)
32Day 2129124 (82.8)
32Day 212925 (17.2)
32Day 222718 (29.6)
32Day 2227219 (70.4)
33Day 3128121 (75.0)
33Day 312827 (25.0)
33Day 322519 (36.0)
33Day 3225215 (60.0)
33Day 322531 (4.0)

 

The code is used:

 

proc import 
	datafile="<path>/dummy.xlsx"
	out=dummy
	dbms=xlsx
	replace;
	sheet="dummy";
	getnames=Yes;
run;

proc format;
	value egres_ (notsorted)	
					1="NORMAL"
					2="ABNORMAL, NCS"
					3="ABNORMAL, CS"
					4="Missing/Not collected"
					;
	value trt (notsorted)		
					1="Drug A"
					2="Drug B"
					3="Placebo"
					;
	value vis (notsorted)		
					1="Day 1"
					2="Day 2"
					3="Day 3"
					;
run;

proc sort data=dummy; by trt01an; run;

ods rtf file="<path>/dummy.rtf"; 
 	 
option orientation=landscape; 
  
proc report  
	data=dummy spacing=1 headskip headline completerows missing spanrows
 	style(report)=[	rules=groups 
				 	frame=void 
				 	just=center
				 	protectspecialchars=off 
				 	cellpadding=1 
				 	cellspacing=1
				 	font_face=consolas
				 	width=75%] 
 	style(header)=[	protectspecialchars=off
				 	cellpadding=1 
				 	cellspacing=1 
				 	background=white
				 	font_face=consolas] 
 	style(column)=[	protectspecialchars=off 
				 	cellpadding=1 
				 	cellspacing=1 
				 	background=white
				 	font_face=consolas]  
	;
 	 
 	column ('\brdrt\brdrs\brdrw' trt01an avisitn ( bavaln bcnt ) ( avaln, pct)); 
 	 
 	define trt01an / group noprint format=trt. preloadfmt; 
 	define avisitn / 'Visits' group order=data style=[just=left] format=vis. preloadfmt; 
 	define bavaln / 'Baseline' group format=egres_. style=[just=left] order=data preloadfmt;
 	define bcnt / 'N' id display style=[just=left];
	define avaln / "Worst post baseline"'\brdrb\brdrs\brdrw' across format=egres_. order=data preloadfmt;
	define pct / "" spacing=1;
 	
 	break after avisitn / skip;
 	break after trt01an / page;
 	
 	compute before _page_ / style=[just=Left font_face=consolas] ;
	 	line @1 "Treatment :" trt01an trt.;
 	endcomp;
	
	title1 j=c "Interpetation shift from Baseline to Worst Postbaseline";
run;

ods rtf close;

 

 

The report am getting:

Ajay05_0-1711385425830.png

Please let me how can i get rid of these missing rows while using the preloadfmt option.

 

2 REPLIES 2
ballardw
Super User

Please provide example data in the form of working data step code.

 

It might help to show us the LOG from your run. Copy the text from the log for the Proc report with all of the notes and messages, open a text box on the forum and paste the text.

 

What does the output look like without inserting raw RTF codes like this: (the \brdrt\brdrs stuff if you aren't familiar)

column ('\brdrt\brdrs\brdrw' trt01an avisitn ( bavaln bcnt ) ( avaln, pct)); 

You may want to examine this thread: https://communities.sas.com/t5/SAS-Programming/Proc-Report-quot-quot-R-RTF-brdrb-brdrs-quot-Issues/t...

 

Cynthia_sas
SAS Super FREQ
Hi: Just fyi, these options spacing=1 headskip headline are all ignored by ODS RTF -- they are all ODS LISTING options that ODS RTF, PDF, HTML, etc. does NOT use.

Cynthia

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

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
  • 2 replies
  • 584 views
  • 0 likes
  • 3 in conversation