BookmarkSubscribeRSS Feed
couchcrusader
Calcite | Level 5
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
1 REPLY 1
ArtC
Rhodochrosite | Level 12
As an aside if you have trouble posting code, consider reading the thread:
http://support.sas.com/forums/thread.jspa?messageID=27609毙

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 777 views
  • 0 likes
  • 2 in conversation