Hi All,
Thanks in Advance,
I want to display sum of all the min and max values for fee. that is the reason i used RBREAK statement. for below code i can get sum for only height. so i need to get sum for min and max also.
proc report data = sasuser.admit out = want;
columns actlevel (min max),fee height;
define fee/analysis sum;
define actlevel/group;
rbreak after/summarize dol dUl;
run;
Thanks.,
Yaswanth
Hi..
Better to use To proc reports to meet your requirement.
proc report data = sasuser.admit out = want;
columns actlevel (min max),fee height;
define fee/analysis sum;
define actlevel/group;
rbreak after/summarize dol dUl;
run;
PRoc report data=want;
columns actlevel _C2_ _C3_ Height;
define Actlevel/"Actlevel";
define _c2_/"Min/Fee";
define _c3_/"Max/Fee";
Define Height/"Height";
rbreak after/summarize dul dol;
run;
Thanks®ards.
Sanjeev.K
Hi,
Try this,
proc report data = sasuser.admit out = want;
columns actlevel (min max),fee height;
define fee/analysis sum;
define actlevel/group;
break after actlevel/ ol skip summarize;
rbreak after/summarize dol dUl;
run;
/Daman
Hi Daman,
Thanks for your quick reply
I have tried with your code. but not meeting exact requirement what i want is, i need to display sum of _C2_ column value in end of the report, same as for the column height..
Thanks,
yaswanth
Hi:
I suggest you change the code as shown below. If you also want SUM for FEE, then remove the SUM statistic from the DEFINE statement and put it in the parentheses with the MIN and MAX statistics. Otherwise, with SUM explicitly in the DEFINE statement, you are sort of giving PROC REPORT conflicting instructions...with MIN and MAX in the COLUMN statement, but then SUM in the DEFINE statement.
cynthia
proc report data = sasuser.admit nowd out = want;
columns actlevel (min max sum),fee height;
define fee/analysis ;
...more code...
Hi Cynthia,
Thank you for your reply..sorry for delayed response, because i was on holiday..
actually what i want to display is, for the variables(minfee, maxfee). i required to get the sum of "min fee" and sum of "max fee". should be like below displayed.
when i trying to execute above code i am getting min value for "min fee", max value for "maxfee" while using rbreak like below.
Please help..
Thanks,
Yaswanth J
Hi Yaswanth
Try this...i think it may help you
proc sort data= sasuser.admit out = admit;
by actlevel;
run;
proc univariate data = admit;
var fee height weight;
by actlevel;
output out = admit1
min= min1
max = max1
sum = sum1 sum2 sum3;
run;
proc report data = admit1 nowd list split = "/";
column actlevel sum2 sum3 sum1 max1 min1;
define actlevel/"/ Actlevel" group width = 8;
define sum2 / " /Height" sum;
define sum3 / " /Weight" sum;
define sum1 / "/Fee" sum;
define max1/ "Max / Fee"sum;
define min1/ "Min / Fee"sum;
rbreak after/ summarize dol ;
run;
or U can try this if you want
proc report data = admit1 nowd list split = "/";
column actlevel sum2 sum3 sum1 max1 min1;
define actlevel/"/ Actlevel" group width = 8;
define sum2 / " /Height" sum;
define sum3 / " /Weight" sum;
define sum1 / "/Fee" sum;
define max1/ "Max/____/ Fee"sum;
define min1/ "Min/____/Fee"sum;
rbreak after/ summarize dol ;
run;
I would be uncomfortable with having the sum of the minimums in the same column as the minimums - too easy to be misinterpreted. The LINE statement could be used (code adapted here for testing against the CLASS data set.
proc report data = sashelp.class nowd;
columns sex (min max),age height;
define sex/group;
define age/analysis sum;
rbreak after/summarize;
compute height;
if _break_=' ' then do;
c2 + _c2_;
c3 + _c3_;
end;
endcomp;
compute after;
line 'Sum of minimums' c2 3.;
line 'Sum of maximums' c3 3.;
endcomp;
run;
Hi..
Better to use To proc reports to meet your requirement.
proc report data = sasuser.admit out = want;
columns actlevel (min max),fee height;
define fee/analysis sum;
define actlevel/group;
rbreak after/summarize dol dUl;
run;
PRoc report data=want;
columns actlevel _C2_ _C3_ Height;
define Actlevel/"Actlevel";
define _c2_/"Min/Fee";
define _c3_/"Max/Fee";
Define Height/"Height";
rbreak after/summarize dul dol;
run;
Thanks®ards.
Sanjeev.K
Thanks Art and sidhu for quick reply ..
I tried with Sanjeev`s code, it`s meeting my requirement..Thanks sanjeev..
Thanks & Regards,
Yaswanth J.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.