displaying space charactere with proc report in ods RTF/PDF

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 19
Accepted Solution

displaying space charactere with proc report in ods RTF/PDF

hello,


i use the proc report to display data of sas dataset in RTF/PDF
same value of columns contain a blank spaces character in the beginning of data followed by other printable characters
we can replace the blank byte(32) by Non-breaking space byte(160) but the length of the space is not the same in the output
is there an option or any way to do that ?
bellow a sas example :

 

 

data test ; 
a=' aaaaaa'; output ; 
a=' bbbbbb'; output ; 
a=' cccccc'; output ; 
run ;
ods rtf ; 
proc report data=test ; 
column a ; 
run ; 
ods rtf close ;

best regard


Accepted Solutions
Solution
‎04-14-2016 11:10 AM
Super User
Super User
Posts: 7,401

Re: displaying space charactere with proc report in ods RTF/PDF

To preserve leading spaces in your text, you will want the little document asis=on option:

data test ; 
  a=' aaaaaa'; output ; 
  a=' bbbbbb'; output ; 
  a=' cccccc'; output ; 
run ;
ods rtf ; 
proc report data=test ; 
 column a style(column)={asis=on}; 
run ; 
ods rtf close ;

View solution in original post


All Replies
Super User
Posts: 10,495

Re: displaying space charactere with proc report in ods RTF/PDF

The most likely cause is the use of a proportional font. You could use an ods style that uses a monospace type font such as Courier or SAS Monospace.

 

Depending on exactly what you need to do there may be other options to control justification. If the intent is to create indented text then adding spaces often does exactly what you describe.

Solution
‎04-14-2016 11:10 AM
Super User
Super User
Posts: 7,401

Re: displaying space charactere with proc report in ods RTF/PDF

To preserve leading spaces in your text, you will want the little document asis=on option:

data test ; 
  a=' aaaaaa'; output ; 
  a=' bbbbbb'; output ; 
  a=' cccccc'; output ; 
run ;
ods rtf ; 
proc report data=test ; 
 column a style(column)={asis=on}; 
run ; 
ods rtf close ;
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 319 views
  • 1 like
  • 3 in conversation