Hi SAS Experts,
I have pre-calculated sums in my source data table:
Example:
Group--Substance--Positives
A______Ivy________34
A______Box________3
Asum______________17
B______Ivy________11
B______Box________25
Bsum______________40
The custom sums are not logical "sums" top-down
but present a "different" way of summing up.
So I cant use a GROUP and BREAK in my PROC REPORT
but must display those custom sums as if they
indeed where just caused by GROUP and BREAK.
There is the problem of order, how does SAS now
that Asum should come after all the A's and second
how to display my pre-calculated number as a "sum" i.e. GROUP / BREAK.
Can someone point me in the right direction?
@RW9, this is a requirement by the end-user.
I have not chosen to create those weird totals/sums
that do not really represent totals.
Just do it in the datastep. If you want subgroups:
data inter;
set want;
if group="Asum" then do;
line="----------------"; output;
line=strip(group)||" - "||strip(put(positives,best.));
line="--------....
run;
So set your dataset up eaxctly as you want the output to look, don't try to do illogical things through logical processes. Alternatively, add another variable to group things?
If your group and substance values are separate variables you should be okay just calling them grouping variables though you may needt to specify that missing values of substance are okay. And if the values are are precalculated then look at using a listing style report, no summary statistics (sum ) needed.
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 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.