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

  • SEARCH
  • Home
  • 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

Ask A Question

Stats

  • Questions 215k
  • Answers 215k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The quickest way I know is window menu > change… May 12, 2026 at 10:54 pm
  • Editorial Team
    Editorial Team added an answer Seems like useless typing to me... and a possible cause… May 12, 2026 at 10:54 pm
  • Editorial Team
    Editorial Team added an answer You can't use primitive types as generic arguments in Java.… May 12, 2026 at 10:54 pm

Related Questions

I have a SAS program that loops through certain sets of data and generates
I would really appreciate any suggestions, no matter how simple or complex, to help
I've got a software running on Linux that is leaking memory. It's an embedded
I am looking for a clean way to forward some demo data using a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.