BookmarkSubscribeRSS Feed
Calcite | Level 5

I am creating a program that generates ods pdf and rtf outputs of proc report tables for different datasets that might be passed in. My system for table wrapping works well if each row has one or two lines of text in it-- I have pageno in my column statement of the proc report so there are only 13 rows on each page, allowing wide tables to wrap immediately following the first half of the table.

		data work.&dataset;
			set lib.&dataset;
			pageno = ceil(_n_/13);

But when the data needs to be wrapped into 3+ lines, it messes up the tables and how they are shown on the pages. Is there a way to fix the number of lines text can wrap to?


I would rather have wider columns and tables than have text wrap to three lines so that my observations are clearly listed together when the table wraps, but I need the column width to be dynamic so it is set automatically by SAS (ie I don't want to make the user set the column width to fix the way the table is presented).


Is there a way to do this?



  Without data and your PROC REPORT code, there's no way to test anything. In general, you need to control the column width when generating your PROC REPORT code, it doesn't happen dynamically.  Just as you're controlling the page size with your pageno variable, you'll have to figure out a way to set the optimum column width that will work for most of your scenarios. This user group paper had a discussion of sizing your output, the discussion focused mainly on PDF vs HTML, but the PDF discussion does also relate to RTF and there were some examples of wrapping.





Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2 in conversation