I need to create a report which contains information about a set of tests, individual results from the tests, and then a column containing the mean result for these tests, as in the format below:
However, I am ending up with the result below:
As can be seen, this is fine before the individual test results, but the columns after them are not displaying as required. Is there a way of doing this without splitting the data out into multiple tables?
The code that I am using for this is below:
proc report data=data nofs spanrows split='*'
style(column)=[font=('Arial',9pt) vjust=middle]
style(header)=[font=('Arial',9pt,bold) background=_und_ vjust=middle]
style(report)=[cellpadding=3pt rules=all frame=box];
column(test_info test individual_result pooled_result further_calculations);
define test_info / order 'Test Information';
define test / order 'Test';
define individual_result / order 'Individual Result';
define pooled_result / order 'Pooled Results';
define further_calculations / order 'Other Calculations Based on The Pooled Result';
run;
Thanks in advance!
apply DISPLAY usage to the middle two variable ,not ORDER.
define test / display 'Test';
define individual_result / display 'Individual Result';
Hi Cynthia,
Thanks for replying. The output I need is RTF, I have included the code I have used for this below. Unfortunately due to limitations within my company I'm not allowed to show any actual data so I just faked some data in the same format as what I need, hence why the tables were so generic! Again, the code used for that is below.
That's what I suspected, the data does need to be in the order specified above so I will investigate the RWI below (and let the person who requested it all be in one table know that it probably won't happen that way!)
Thanks again for your help,
Abby
data data;
input test_info $40. test individual_result pooled_result further_calculations;
datalines;
Multiple Columns Containing Information 1 1 1.5 5
Multiple Columns Containing Information 2 2 1.5 5
;
run;
options papersize=a4 orientation=portrait nonumber nodate;
ods rtf file="C:\Users\morelax5\Documents\Example Tables.doc" startpage=no style=MyStyleRTF;
goptions reset=all;
goptions device=zpng target=zpng xmax=8in ymax=5in hsize=8in vsize=5in xpixels=2880 ypixels=1800
rotate=portrait ftext='Arial' htext=11pt;
ods escapechar='~';
proc report data=data nofs spanrows split='*'
style(column)=[font=('Arial',9pt) vjust=middle]
style(header)=[font=('Arial',9pt,bold) background=_und_ vjust=middle]
style(report)=[cellpadding=3pt rules=all frame=box];
column(test_info test individual_result pooled_result further_calculations);
define test_info / order 'Test Information';
define test / order 'Test';
define individual_result / order 'Individual Result';
define pooled_result / order 'Pooled Results';
define further_calculations / order 'Other Calculations Based on The Pooled Result';
run;
ods rtf close;
apply DISPLAY usage to the middle two variable ,not ORDER.
define test / display 'Test';
define individual_result / display 'Individual Result';
Odd, that's what I originally had and it didn't work which is why I changed them to order to see if it did. I've just tried again and it has worked!
Thanks!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.