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-2024.png

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.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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