BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am concatenating a string in a compute block of a PROC REPORT.

description= Part1 || " " || Part2;

Part1="United States"
Part2= "(Continued)"

The resulting rtf string is

United\~States\~(Continued)

I need spaces not unbreakable spaces (\~).

How do I do that?

JK
2 REPLIES 2
Tim_SAS
Barite | Level 11
Sorry, John. There's no way to do this with REPORT. Then nonbreaking spaces are deliberate. REPORT really wants each LINE statement to create exactly one line of output. Possibly you could post-process the RTF output but that's out of my league.
Olivier
Pyrite | Level 9
Although you cannot get rid of the unbreakable spaces inserted by proc Report, you can add your own breakable spaces where you think you should have some... Use ODS ESCAPECHAR="^" ; (for instance) and then the breakable space is ^w. Just add it in your code, something like :

description= Part1 || "^w" || Part2;

If you resize the table in the RTF document, that would cut the text between part1 and part2.

Regards,
Olivier

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

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
  • 1889 views
  • 0 likes
  • 3 in conversation