BookmarkSubscribeRSS Feed
SAS93
Quartz | Level 8

I'm using ODS RTF to output Proc Reports to a Word document. The following is my code:

 

		ods rtf file='C:\Annual Summary Reports_2018-forward\Rolling Reports\AUTOLIB\Tables.rtf' noKEEPN; 
		options nodate nonumber orientation=portrait ;

				** PROC REPORT work;
				Proc report data=year3_region out=report_&thisname 
					nowd
					 STYLE(report) = [rules=none frame=hsides background=white cellspacing=0 cellpadding=.20] 
					 STYLE(header) = [foreground=black background=white	cellheight=.23in 
							borderbottomwidth=2.0pt borderbottomcolor=black
							bordertopwidth=.5pt bordertopcolor=white
							borderleftwidth=.5pt borderleftcolor=white
							borderrightwidth=.5pt borderrightcolor=white]
					;

					Column	region YY4_DOB,Percent dummyvar;

						Define	region / group
								style(column) = {cellheight=.23in cellwidth=1.0in
								vjust=bottom just=left
									borderleftcolor=white borderleftwidth=.5pt
									borderrightcolor=white borderrightwidth=.5pt paddingright=.05in};

						Define yy4_DOB / across
								style(column) = {cellheight=.23in cellwidth=1.25in
								vjust=bottom just=Middle
									borderleftcolor=white borderleftwidth=.5pt
									borderrightcolor=white borderrightwidth=.5pt paddingleft=.05in};

						Define Percent / display 
								style(column) = {cellheight=.23in cellwidth=1.25in
								vjust=bottom just=left
									borderleftcolor=white borderleftwidth=.5pt
									borderrightcolor=white borderrightwidth=.5pt paddingleft=.05in};

						Define dummyvar / computed noprint ;
						 compute dummyvar;
						 dummyvar = 1;
						 endcomp;
				Run;
			ODS rtf CLOSE;

 

 

This causes the following type of output. This is largely what I'm after, but I want the 2nd and 3rd lines to be less bold, and I can't figure out how to get it to display all the estimates without having all that space--this does not show up in the SAS output itself. Those estimates are a the result of a concatenation of 3 other variables in a previous data step:

      Percent=Row_Percent || "%(" || Lower_CL || ", " || Upper_CL || ")" ;

 

example2.png

How do I get rid of the extra spaces/wrapping AND how do I get rid of that "The SAS System" at the top?

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

> How do I get rid of the extra spaces/wrapping

Remove trailing spaces like this?

 Percent = catt(Row_Percent, "% (" , Lower_CL, ", " , Upper_CL, ")" ) ;

> how do I get rid of that "The SAS System" at the top?

Remove the title.

title;
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
  • 1 reply
  • 1706 views
  • 0 likes
  • 2 in conversation