Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 411391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:58:57+00:00 2026-05-12T17:58:57+00:00

I have some PROC REPORT code that generates a report with 2 levels of

  • 0

I have some PROC REPORT code that generates a report with 2 levels of grouping, but the RBREAK always just summarizes for everything. I get something like this for example:

    Row1: Type A  Before  100 200 300  
    Row2:         After   400 500 600   
    Row3: Type B  Before  100 200 300  
    Row4:         After   400 500 600  
    Row5: Total           700 800 900

Is there any way to get PROC REPORT to summarize with that second level grouping intact? I have 140,000+ observations, and right now I’m duplicating every observation and setting the first level grouping variable to one constant value to get a manufactured total row with the second level grouping included:

    Row1: Type A  Before  100 200 300  
    Row2:         After   400 500 600   
    Row3: Type B  Before  100 200 300  
    Row4:         After   400 500 600  
    Row5: Total   Before  700 800 900
    Row6:         After   701 801 901

Or even if PROC REPORT can’t do anything automatically, is there a better way to get the total at the bottom? I wish I could use multi-label formats…but they don’t work in PROC REPORT as far as I know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:58:57+00:00Added an answer on May 12, 2026 at 5:58 pm

    This is really easy to do with proc tabulate:

    /* test data */
    data one;
      do type = "A", "B";
        do time = "Before", "After";
           drop AfterPremium;
           AfterPremium = 300 * (time="After");
           v1 = 100 + AfterPremium;
           v2 = 200 + AfterPremium;
           v3 = 300 + AfterPremium;
           output;
        end;
      end;
    run;
    
    proc tabulate data=one order=data formchar="|-+++++++++";
      class type time;
      var v1-v3;
      tables (type all="All Types")*time, (v1 v2 v3)*sum;
    run;
    /* on log
    +----------------------+------------+------------+------------+
    |                      |     v1     |     v2     |     v3     |
    |                      +------------+------------+------------+
    |                      |    Sum     |    Sum     |    Sum     |
    +----------+-----------+------------+------------+------------+
    |type      |time       |            |            |            |
    +----------+-----------+            |            |            |
    |A         |Before     |      100.00|      200.00|      300.00|
    |          +-----------+------------+------------+------------+
    |          |After      |      400.00|      500.00|      600.00|
    +----------+-----------+------------+------------+------------+
    |B         |Before     |      100.00|      200.00|      300.00|
    |          +-----------+------------+------------+------------+
    |          |After      |      400.00|      500.00|      600.00|
    +----------+-----------+------------+------------+------------+
    |All Types |Before     |      200.00|      400.00|      600.00|
    |          +-----------+------------+------------+------------+
    |          |After      |      800.00|     1000.00|     1200.00|
    +----------+-----------+------------+------------+------------+
    */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some UI in VB 2005 that looks great in XP Style, but
I have some code for starting a thread on the .NET CF 2.0: ThreadStart
We have some input data that sometimes appears with &nbsp characters on the end.
I have some C# / asp.net code I inherited which has a textbox which
I have some code like this in a winforms app I was writing to
We have some files on our website that users of our software can download.
I have some ASP.NET web services which all share a common helper class they
I have some classes layed out like this class A { public virtual void
I have some kind of test data and want to create a unit test
I have some strings of xxh:yym format where xx is hours and yy is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.