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;
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
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
Cynthia's answer is correct.
Here is what the code looks like:
computer per_osha;
if _break_="_RBREAK_" then per_osha.sum=100;
endcomp;
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 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: