I am trying to create the table using proc report but the order seems changed but I have no idea why and how to solve it. Here are my codes: data test;
infile datalines dlm=",";
informat x $10.
y $20.
z $20.
group $20.
description $20.;
input x $ y $ z $ group $ description $;
datalines;
X,A,Total (N=2000),Total,709 (35.5 %)
X,B,Total (N=2000),Total,190 (9.5 %)
X,C,Total (N=2000),Total,2 (0.1 %)
X,A,0 (N=57),Total,23 (40.4 %)
X,B,0 (N=57),Total,4 (7 %)
X,C,0 (N=57),Total,0 (0 %)
X,A,I (N=393),Total,155 (39.4 %)
X,B,I (N=393),Total,29 (7.4 %)
X,C,I (N=393),Total,0 (0 %)
X,A,II (N=551),Total,188 (34.1 %)
X,B,II (N=551),Total,52 (9.4 %)
X,C,II (N=551),Total,0 (0 %)
X,A,Total (N=1520),0,537 (35.3 %)
X,B,Total (N=1520),0,138 (9.1 %)
X,C,Total (N=1520),0,2 (0.1 %)
X,A,0 (N=57),0,23 (40.4 %)
X,B,0 (N=57),0,4 (7 %)
X,C,0 (N=57),0,0 (0 %)
X,A,I (N=349),0,138 (39.5 %)
X,B,I (N=349),0,25 (7.2 %)
X,C,I (N=349),0,0 (0 %)
X,A,II (N=424),0,145 (34.2 %)
X,B,II (N=424),0,42 (9.9 %)
X,C,II (N=424),0,0 (0 %)
X,A,Total (N=480),1,172 (35.8 %)
X,B,Total (N=480),1,52 (10.8 %)
X,C,Total (N=480),1,0 (0%)
X,A,I (N=44),1,17 (38.6 %)
X,B,I (N=44),1,4 (9.1 %)
X,C,I (N=44),1,0 (0%)
X,A,II (N=127),1,43 (33.9 %)
X,B,II (N=127),1,10 (7.9 %)
X,C,II (N=127),1,0 (0%)
;
run;
proc report data=test missing;
column x y group, (z, description);
define x/' ' group order=data;
define y/' ' group order=data;
define z/' ' order=data across ;
define group/' ' order=data across nozero;
define description/ ' ' group ;
run; And the output looks like But I would like it to be the following where the total one is ahead of the 0 term. Any solution for solving it? Thanks!
... View more