Flattening "proc report" output

WORK IN PROGRESS

Introduction

Every so often I make a prediction about the use of SAS in clinical trials programming. I usually get it wrong. My prediction for 2008 is that "proc report" will get a lot more use, especially by CROs creating reports for their study sponsors. The reason I predict this is because it seems that RTF ("Rich Text Format") reports are coming into their own because they look better and are more convenient for copying and pasting values. From what I have seen of CRO reporting systems in Europe, many of them are based on "data _null_" reports. It is not easy to use ODS with "data _null_" to create RTF reports so these reports will have to be rewritten using "proc report" where the use of ODS to create RTF files is very easy.

Although "proc report" has been around for a good number of years, skill with it is limited among sas programmers who work in the field of clinical reporting. Getting the "proc report" output to look right is still a challenge. One of the challenges is in avoiding unwanted lines in the report column headers and avoiding unwanted gaps in the data display. How to achieve this is not intuitive. A few "tricks" and techniques must be learned.

This page is going to be a long tutorial and the aim is to teach you those tricks and techniques you need to know to achieve a nicely "flattened" proc report output. By "flattened" is meant avoiding unwanted column header lines and unwanted gaps in the data display. You will be strongly encouraged to run sas code yourself to experiment with "proc report", so to help you, some datasets will be made available for you to practise on.

Before we start, I know that many of you will not have time to work through this tutorial and even if you did, a lot of people won't bother, so I am going to reveal the ultimate recommendation here, as I will in the Conclusion, and that is when using "proc report", it is best to transpose your datasets, if your datasets are not already in a convenient form, so that each column shown in the report is an individual variable. That way you have more control over the output, you will not be plagued with unwanted line throws and gaps in the data display and you can adjust the spacing between individual columns and so make the report look good.

The datasets

The data I am going to provide you to practise on is real study data, except it has been reblinded and transformed a bit. This was sent to me and I have got permission from the sender to web it. So this is not an exercise where I am trying to make my favourite point about "proc report". Instead this is using real data to produce a typical (though simple) example of a real report.

The datasets you can link to below are the original data (though reblinded and transformed) followed by three datasets produced by the Spectre %unistats macro. The %unistats macro can produce three output datasets. The first is a straightforward dataset with descriptive statistics and the next two are transposed datasets -  the first transposed by treatment variable and the second transposed by statistics keyword (MIN, MEAN, MAX etc.). When using the %unistats macro, you are expected to always ask the macro to transpose your output data rather than doing it yourself in your code. This is to make the task of "validation" easier. To find out the contents of these datasets you can either download them and look at the contents using sas or you can read the description of the contents in the header of the macro %unistats.
 
 
 


 
 

Go back to the home page.

E-mail the macro and web site author.