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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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