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;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.