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

Please see my code below. In the output ^{nbspace 3} does not work.

ods ESCAPECHAR="^";

data x;

x="^S={fontweight=bold}Age (years) ^S={fontweight=light}^{newline} ^{nbspace 3}n ^{newline}^{nbspace 3}Mean ± SD ^{newline}^{nbspace 3}Median (Range)";

run;

ods rtf file='XXX\try.rtf';

proc report data=x;

run;

ods rtf close;

 

I want to get below output:

Capture.JPG

 

but the rtf output is blow:

Capture_2.JPG

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

By default Proc Report will left justify text fields, removing spaces as needed.

You would need to define a style override for the variable to use Style =[ASIS=On] in a define statement.

Something like:

proc report data=work.x;
define x / style=[Asis=on];

run;

You are likely to get some interaction between the actual column width and your newlines making it appear as if there are extra blank lines if your column is not wide enough depending on Ods destination and I'm not sure about a consistent fix for that.

 

 

View solution in original post

2 REPLIES 2
ballardw
Super User

By default Proc Report will left justify text fields, removing spaces as needed.

You would need to define a style override for the variable to use Style =[ASIS=On] in a define statement.

Something like:

proc report data=work.x;
define x / style=[Asis=on];

run;

You are likely to get some interaction between the actual column width and your newlines making it appear as if there are extra blank lines if your column is not wide enough depending on Ods destination and I'm not sure about a consistent fix for that.

 

 

Niugg2010
Obsidian | Level 7

If add define x / style=[Asis=on]; the space issue can be fixed. Thanks

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1867 views
  • 0 likes
  • 2 in conversation