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 ;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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