The SAS Output Delivery System and reporting techniques

proc report rbreak summarize

Accepted Solution Solved
Reply
Regular Contributor
Posts: 199
Accepted Solution

proc report rbreak summarize

I am adding up tot_osha and per_osha using rbreak summarize.
However, I would like to change the sum of per_osha to 100.
How do I accomplish this?
Thank you.

proc report data=csbu3 nowd contents="Claims" out=test
style(header)=[font_weight=bold background=CX90D9D7 /*very light bluish green*/];
options missing='';
column ydoi1 task1 tot_osha per_osha;
define ydoi1 / noprint;
define task1 / 'Task';
define tot_osha / analysis "2011 YTD Total" style(column)={background=CXE599A7};
define per_osha / analysis "% of 2011 Total" style(column)={background=orange};
rbreak after / summarize;
compute per_osha;
  if _break_="_RBREAK_" then per_osha=100;
endcomp;
run;


Accepted Solutions
Solution
‎07-28-2011 09:22 AM
SAS Super FREQ
Posts: 8,865

Re: proc report rbreak summarize

Hi:

  When you use an ANALYSIS variable in a COMPUTE block, you must use the compound form of the name for reference in syntax:

itemname.statisticname

For example, if you had these DEFINE statements:

define age / mean 'Age';

define amount / analysis 'Amt';

define total / sum 'Tot';

define change / min 'Minimum';

Then the COMPUTE block references would be:

AGE.MEAN

AMOUNT.SUM

TOTAL.SUM

CHANGE.MIN

A usage of ANALYSIS implies the SUM statistic, so the compound name for your item would be:

PER_OSHA.SUM

cynthia

View solution in original post


All Replies
Solution
‎07-28-2011 09:22 AM
SAS Super FREQ
Posts: 8,865

Re: proc report rbreak summarize

Hi:

  When you use an ANALYSIS variable in a COMPUTE block, you must use the compound form of the name for reference in syntax:

itemname.statisticname

For example, if you had these DEFINE statements:

define age / mean 'Age';

define amount / analysis 'Amt';

define total / sum 'Tot';

define change / min 'Minimum';

Then the COMPUTE block references would be:

AGE.MEAN

AMOUNT.SUM

TOTAL.SUM

CHANGE.MIN

A usage of ANALYSIS implies the SUM statistic, so the compound name for your item would be:

PER_OSHA.SUM

cynthia

Regular Contributor
Posts: 199

proc report rbreak summarize

Posted in reply to Cynthia_sas

Cynthia's answer is correct.

Here is what the code looks like:

computer per_osha;

if _break_="_RBREAK_" then per_osha.sum=100;

endcomp;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 298 views
  • 0 likes
  • 2 in conversation