The SAS Output Delivery System and reporting techniques

display each row

Reply
N/A
Posts: 0

display each row

Hi everyone,
I was wondering if anyone could help me with a question I have with proc report. I used the following codes to create a table ordered by the variable "count". I used ods msoffice2k option to save my table in excel. The problem I had was cell values for "count" became missing when the adjacent cells were associated with the same value. Does anybody know of a way to force the values of the order variable to be presented in the table? Thanks very much in advance.

ods msoffice2k file="freq_sex.xls " path=odsout style=minimal ;

proc report data=report nowd headline headskip ;

columns sex_1 count pct_total;

define sex_1 / display "Field Name" left ;
define count / order descending "Record Count" center ;
define pct_total / display "Percent Total";

run ;

Sample output:

Field Name Record Count Percent Total
Female 121 50%
Male 50%
SAS Super FREQ
Posts: 8,743

Re: display each row

Hi:
These couple of examples may help...not with a count variable, just with sashelp.class and how to show a value for an order or group variable (use a computed column).
cynthia
[pre]
ods msoffice2k file="c:\temp\prtgend.xls "
style=minimal ;

proc report data=sashelp.class nowd ;
title 'proc report examp -- use NOPRINT on SEX var after seeing how PRTGEND works';
columns sex prtgend name age;
define sex / order "Gender1 as Order";
define prtgend / computed 'Gender2';
define age / display "age";
compute before sex;
length holdvar $1;
holdvar = sex;
endcomp;
compute prtgend / character length=1;
prtgend = holdvar;
endcomp;
run ;

proc report data=sashelp.class nowd;
title 'Summary Report with Proc Report';
columns sex n pctn;
define sex / group 'Gender';
define n / 'Count';
define pctn / 'Percent' f=percent8.2;
rbreak after / summarize;
run;
ods msoffice2k close;
[/pre]
N/A
Posts: 0

Re: display each row

Thank you Cynthia! It worked.
Ask a Question
Discussion stats
  • 2 replies
  • 110 views
  • 0 likes
  • 2 in conversation