BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
TashaChapman
Fluorite | Level 6

I'm having some issues with PROC Report and I'm just banging my head against the wall here (it's probably something stupid)...

I'm passing my data through PROC Report twice - once to produce some calculations, etc., and the other to create the final report.  The issue I'm having is with step two.

Here is the data:

AgeGroup_C2__C3_change1pchange1_C4_change2pchange2_C5_change3pchange3
Less than 12512625152-26-0.0010325102240.0009552371014160.05636
1 to 5117318117668-350-0.00298118066-748-0.0063887173301450.25695
6 to 121416211414761450.00102413740242190.02979193923476980.3368
13 to 18102062102078-16-0.000169846835940.03521465267367950.36052

And here is my code:

ods pdf file="Test.pdf";

proc report nowd data=testrep;

column agegroup ("Jan-13" _c2_) ("Dec-12" _c3_ change1 pchange1) ("Jan-12" _c4_ change2 pchange2) ("Healthy Kids Baseline" ("Jun-09" _c5_ change3 pchange3));

define agegroup / display 'Age';

define _c2_ / display 'Current' format=comma12.;

define _c3_ / display 'Previous Month' format=comma12.;

define change1 / display 'Change' format=comma12.;

define pchange1 / display '% Change' format=percentn14.2;

define _c4_ / display 'Previous Year' format=comma12.;

define change2 / display 'Change' format=comma12.;

define pchange2 / display '% Change' format=percentn14.2;

define _c5_ / display 'Baseline' format=comma12.;

define change3 / display 'Change' format=comma12.;

define pchange3 / display '% Change' format=percentn14.2;

rbreak after / summarize;

run;

ods pdf close;

For some reason the Rbreak is not producing a total row like I would like.  In the PDF, it is coming out completely blank.  Anyone know why?

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi, Tasha:

  Several factors have to work together for PROC REPORT to generate a summary line at the end of a report:

1) you need an RBREAK AFTER/ SUMMARIZE statement (check)

2) the variables that you want to summarize cannot be DISPLAY (NOT check in the code you show)

  I'd recommend changing some of the DISPLAY to SUM and see what happens.

cynthia

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi, Tasha:

  Several factors have to work together for PROC REPORT to generate a summary line at the end of a report:

1) you need an RBREAK AFTER/ SUMMARIZE statement (check)

2) the variables that you want to summarize cannot be DISPLAY (NOT check in the code you show)

  I'd recommend changing some of the DISPLAY to SUM and see what happens.

cynthia

TashaChapman
Fluorite | Level 6

I had a feeling it would be something like that.  Thanks for the suggestion!

Actually, what I ended up doing is adding the rbreak to the first pass-through PROC Report statement.  In the end I got an extra observation in my testrep dataset with the sums I needed.  This also allowed me to give the row a header of "Total" in the dataset by changing the "AgeGroup" value for that row.  So far it's working like a charm. Smiley Happy

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 906 views
  • 3 likes
  • 2 in conversation