Help using Base SAS procedures

Proc report compute with _break_ not working for me

Reply
New Contributor
Posts: 3

Proc report compute with _break_ not working for me

Hello,

First of all, hopefully my post doesn't get cut off partway through - that's what happened last time I posted anything!

Below I have provided some proc report syntax I am using - admittedly it is my first time using proc report. The syntax is not giving me the results in the format I expect for the region and age subgroups. My syntax shows that I would like age subtotals to be labelled "Subtotal" and regional subtotals to be labelled "Regional Total", but instead my output for both age subtotals and region subtotals appear with the label "Unknown". I am running SAS verstion 9.1.3. Does anybody know why this is happening? Thanks in advance for any insight you have.

proc report data=xxxxxx NOWINDOWS;
COLUMN region age gender overall_count discrete_count average_amount;

define age/GROUP format=fmt_agegroup. 'Age/Group';
define gender/GROUP format=$fmt_gender. ORDER=freq 'Gender';
define overall_count/ANALYSIS 'Total/Count';
define discrete_count/ANALYSIS 'Discrete/Count';
define average_amount/COMPUTED format=5.2 'Average' width=12;
define region/GROUP format=$fmt_region. ' ';

COMPUTE average_amount;
average_amount=overall_count.SUM/discrete_count.SUM;
endcomp;

break after region/SUMMARIZE UL suppress;
break after age/SUMMARIZE UL suppress;

compute region/CHAR;
if UPCASE(_break_)= 'REGION' then region = 'Regional Total';
endcomp;
compute age/CHAR;
if UPCASE(_break_) = 'AGE' then age = 'Subtotal';
endcomp;

run; I figured out my problem. I had put an OTHER="Unknown" for the age and region in a prior proc format. Now that I've removed that, my syntax is fine.


Message was edited by: couchcrusader
Valued Guide
Posts: 634

Re: Proc report compute with _break_ not working for me

Posted in reply to couchcrusader
As an aside if you have trouble posting code, consider reading the thread:
http://support.sas.com/forums/thread.jspa?messageID=27609毙
Ask a Question
Discussion stats
  • 1 reply
  • 131 views
  • 0 likes
  • 2 in conversation