Hi:
You can get counts and percents from either PROC REPORT or PROC TABULATE using the N and PCTN statistic.
For more help with the syntax of either procedure or the syntax of the program example below or for help creating a dataset from ODS procedure output, your best bet is to contact SAS Technical Support. Also, many companies that do clinical trial reporting ALREADY have procedures and macro programs that they use to generate the kinds of reports that you ask about. So, before you go too far down the road of ANY procedure, you should check with other programmers at your company to determine what validated programs and methods are already in use.
To contact SAS Technical Support, go to
http://support.sas.com/ and in the left-hand navigation pane, click on the link entitled "Submit a Problem".
cynthia
Some example code:
[pre]
data defects;
length system $20 defect $20;
infile datalines;
input system $ defect $;
return;
datalines;
Cardiovascular Atheroscelorosis
Neurology Vertigo
Cardiovascular Myocardialinfarction
Nephrology Renal Failure
Gastroenterology Gastritis
Gastroenterology Jaundice
Gastroenterology Gastritis
Cardiovascular Myocardialinfarction
;
run;
proc format;
picture pct low-high='009.99%';
run;
ods html file='c:\temp\pctrept.html' style=sasweb;
proc tabulate data=defects ;
title 'Percents and Counts with PROC TABULATE';
class system defect;
table system=' ' * (all defect=' ' ) all,
n pctn*f=pct. /
box='system and defect';
run;
proc report data=defects nowd
style(summary)=Header;
title 'Percents and Counts with PROC REPORT';
column system defect n pctn;
define system /group
style(column)=Header;
define defect/group
style(column)=Header;
define n/ 'N' f=comma6.;
define pctn / 'PctN' f=percent8.2;
break before system/ summarize;
compute before system;
defect = 'All';
endcomp;
compute after system;
line ' ';
endcomp;
rbreak after /summarize;
compute after;
system = 'All';
defect = 'All';
endcomp;
run;
ods html close;
[/pre]