BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
reznac
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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

2 REPLIES 2
ballardw
Super User

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.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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 ;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 3907 views
  • 1 like
  • 3 in conversation