Help using Base SAS procedures

RBREAK IN PROC REPORT

Reply
N/A
Posts: 0

RBREAK IN PROC REPORT

HI all,
This is my data set..........

STAGE X Y Z TOTAL
A 1 2 2 5
B 3 6 9 18
C 1 2 5 8
TOTAL 5 10 16 31

By using rbreak in proc report we can get this 'TOTAL' row means we can summarize the data but instead of total i want percentage of data values with respect to total and with % sign along with it..Like..........

TOTAL 16.1% 32.2% 51.6% 100%

SO IS IT POSSIBLE?

Thanks for ur help...........
PROC Star
Posts: 1,561

Re: RBREAK IN PROC REPORT

proc report is not my cup of tea, but since no one replied, here is my ugly solution.

proc format ;
value weight 0-1=[percent.];

proc report data=sashelp.class;
define sex /group;
define age /across ;
define weight/sum format=weight6.;
column sex age,weight ;
rbreak after/summarize;
compute after;
TOTAL=sum(_C2_, _C3_ , _C4_ , _C5_ , _C6_, _C7_ );
_C2_=_C2_/TOTAL;
_C3_=_C3_/TOTAL;
_C4_=_C4_/TOTAL;
_C5_=_C5_/TOTAL;
_C6_=_C6_/TOTAL;
_C7_=_C7_/TOTAL;
endcomp;
run;
quit;
SAS Super FREQ
Posts: 8,743

Re: RBREAK IN PROC REPORT

Hi:
This person posted in multiple forums. There were 2 answers posted in a different forum location.
cynthia
N/A
Posts: 0

Re: RBREAK IN PROC REPORT

Thanks a lot Chris.......
and thanks to u too cynthia..
and no one replied on the previous forum thats why i have posted it again in different forum and also the reply which i got in that that was wrong..
bt the reply in this is working exactly..
thanks again Chris...
PROC Star
Posts: 1,561

Re: RBREAK IN PROC REPORT

No worries, Mittal. Sorry Cynthia, I didn't see the other post.
Ask a Question
Discussion stats
  • 4 replies
  • 113 views
  • 0 likes
  • 3 in conversation