BookmarkSubscribeRSS Feed
BobHope
Quartz | Level 8

landHi,

I am struggling with PROC REPORT a lot. Firstly I would need to somehow "compress" the output since my report is in RTF landscape, and the headers of the report columns might be quite long and steal most of the space available on the page. The problem is that if the header takes a lot of room then only 1-3 observation rows will fit into the landscape page, and every time a page changes the header is replicated by default in PROC REPORT. This leads to an "infinite loop" where there will be thousands of pages all containing only few observations and all other area is filled with the headers. So what I would want is that there would be only one header per PROC REPORT print, so that the table would continue to the next page without the header replication.

Edit:

I attached an example of my PROC REPORT code.

It might be that my SAS knowledge is too limited or this problem is not doable with SAS but I hope someone could help me out.

There could be an optional way to reduce the header size with font size (but this method is really limited since the text becomes unreadable very soon). Other way would be that if I could somehow control the total width of the main across variable (in sample code var5) and let the second across variable (sample code var6) vary in length freely "under" the first across variable. This however does not work with outputwidth command and I have to fix both across variable widths as a constant. My report is dynamic and constant column widths are "stupid" for my use (in my opinion this is one of the biggest issues with SAS, compared to competitive alternatives, that you can't explicitly tell PROC REPORT to have total maximum width for the table and under that constraint it can automatically decide the proper widths for the columns, PLEASE CORRECT ME IF I AM WRONG).

1 REPLY 1
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well.  Firstly I would say that is a bad idea.  It make reviewing the table very difficult as you constantly need to scroll up to see what each column is.  My recommendation is to shrink the headers to a reasonable length, they are after all descriptives and need to be verbose.  So instead of:

This column header was created on 12jun2014 using data derived from version 1 of the data and is the component.

Use:

Component

With a footnote to explain it.  There are numerous techniques for this and different approaches.

If you really need to do it, and are prepared for the backlash from the reviewer then:

- Create a row in your dataset with the labels

- Proc report the data, and set the labels to missing

I wouldn't recommend it though.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 1102 views
  • 3 likes
  • 2 in conversation