Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!

SAS ODS Report Writing Interface

Occasional Contributor
Posts: 16

SAS ODS Report Writing Interface

Dear all,

I have a table shell that I need to generate from sample data set and thought SAS report writing Interface would be the best bet for the output I need. Normally, I use proc tabulate or proc report to generate this kind of output. But, I came to know that these procedures wont work for the table shell below. 
Attached please find the sample data set. 
data have;
input id sex$ race$ age agecat$;
01 F W 66 60-70
02 F B 87 80-90
03 M W 63 60-70
04 M A 79 70-80
05 M W 75 70-80
06 M U 72 70-80
07 F W 66 60-70
08 F B 87 80-90
09 M W 63 60-70
10 M A 79 70-80
11 M W 75 70-80
12 M U 72 70-80
The table shell is below. Can I generate the exact table shell using the SAS RWI. If so, could you please provide the program to generate this table shell. 
DescriptivesOverall Cohort  Males Females 
 MeanStandard DeviationMeanStandard DeviationMeanStandard Deviation
 25% IQR75% IQR25% IQR75% IQR25% IQR75% IQR
Age Group      
60-70 yearsN%N%N%
70-80 yearsN%N%N%
80-90 yearsN%N%N%
Thank you very much for your help!
Posts: 9,436

Re: SAS ODS Report Writing Interface

I'm not sure why you think that PROC REPORT won't work for this report. It might be that either REPORT or TABULATE would work for this report.

There are a lot of papers on the Report Writing Interface. Here are some of them:
“Using ODS Object Oriented Features To Produce a Formatted Record Layout”
“Using the Data Step to Create Bar Charts: The ODS Report Writing Interface” Available at
"That's All Right: More Complex Reports."
“Next Generation Data _NULL_ Report Writing Using ODS OO Features”
“ODS Report Writing Interface Makes Our Reporting Simple and Better”
“Next Generation DATA _NULL_ Report Writing using ODS OO Features: A Powerful Tool to Create Custom Tables”

But unless your data are not in the right structure, I don't see anything here that PROC REPORT could not do either.

Super User
Posts: 13,950

Re: SAS ODS Report Writing Interface

Posted in reply to Cynthia_sas



A previous post provided a "close" Proc Tabulate solution but apparently having two tables isn't quite what the OP wants.

I suggested an RWI approach may be possible but haven't the time or inclination at this point to try to cobble something that non-standard together as it was reminding me entirely too much of the programs with 400 PUT statements to put a dozen or so "tables" on a single page from many years ago.

Posts: 9,436

Re: SAS ODS Report Writing Interface

Yes, I agree, I'm not inclined to find the interquartile range on the data that was posted because I'm not sure what procedure the OP is going to use to calculate that value and if I guess I could guess wrong.

But this layout is very similar to the type of report that I showed in my 2008 Creating Complex Reports paper, with the added benefit of having a separate column for the N and a separate column for the %, which makes generating the report much easier.

Super User
Posts: 24,028

Re: SAS ODS Report Writing Interface

It’s possible but the odds of getting someone to write the code for you is less likely. If you start you’ll probably get help but actually doing it all isn’t likely to happen. There’s a few consultants out there who would do it for a fee.
Ask a Question
Discussion stats
  • 4 replies
  • 4 in conversation