Hi:
When I tried to read your file, the issue I ran into was the tabs generated missing values with your type of input. This worked better for me.
data test;
length serv $5 table $5 comp $8;
infile datalines dlm=',' dsd;
input serv $ table $ comp $ numb ;
dataord = _n_;
datalines;
Boy,2796,Active,41043
Boy,2796,Reserve,7024
Boy,2796,missing,72
Boy,PHA,Active,274220
Boy,PHA,Reserve,95291
Girl,2796,Active,3200
Girl,2796,Reserve,1231
Girl,2796,missing,5
Girl,PHA,Active,121634
Girl,PHA,Reserve,36043
Dad,2796,Active,9915
Dad,2796,Reserve,310
TOTAL,2796,Active,77283
;
run;
I added a "DATAORD" variable to capture the original order of the variables, thinking it might help, but your input data is not in the order shown in your desired results, so I'm not sure it is useful.
However, without some direction or a helper variable, to assure the desired ordering, PROC REPORT would not be able to do the type of ordering you show. What PROC REPORT code have you tried?
Cynthia
... View more