The SAS Output Delivery System and reporting techniques

Keep leading spaces and blank records

Reply
Occasional Contributor
Posts: 16

Keep leading spaces and blank records

Hi,

I'm trying to create demographics table. For alignment purpose I'm using a macro described in following paper. 

http://www.pharmasug.org/proceedings/2013/CC/PharmaSUG-2013-CC15.pdf

 

My problem is, I'm able to get aligned values in dataset but when I'm using proc report to output in ODS rtf, all the leading blanks, used for alignment are lost. I tried using other characters like << instead of blanks and it's working fine. Looks like only blanks has some problem. I also tried style(column)={asis=on}; but still its removing all leading blank spaces. 

 

Please help!

Super User
Posts: 9,867

Re: Keep leading spaces and blank records

1) style(column)={pretext=' '}; 2) use TAB character '09'x instead of white blank . 3) use escapechar : data new; set have; column='~_~_~_~_'||column; run; ods escapechar='~'; proc report data=new nowd.
Super User
Super User
Posts: 7,720

Re: Keep leading spaces and blank records

Hi,

 

This is something I do alot and asis=on should work fine.  Try the code below, make sure you have put the asis in the right place, and that the spaces are actually in the data - i.e. is there something triming or stripping the data&colon;

data have;
  a="Abcd"; output;
  a="  Defg"; output;
run;
ods rtf file="s:\temp\rob\tmp.rtf";
proc report data=have nowd;
  columns a;
  define a / style(column)={asis=on};
run;
ods rtf close;
Super User
Posts: 11,134

Re: Keep leading spaces and blank records

It may help to show  exactly how you made your data, some example data and the whole code for that example data that you attempted and what isn't quite working.

It would also help to show exactly how you would desire the output to look for the example data.

Ask a Question
Discussion stats
  • 3 replies
  • 848 views
  • 1 like
  • 4 in conversation