BookmarkSubscribeRSS Feed
sathya66
Barite | Level 11

Hi All

please find the attached.

I need an output like

TOTAL A  =All Total-Total B.

 

by using proc report only please.

 

Thanks,

Sathya.

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Some of us refuse to download and open .xlsx (and other MS Office) documents because they can be a security threat.

 

Please show us your data in the form of SAS data set Code as described here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

--
Paige Miller
sathya66
Barite | Level 11

Thanks,

namea1T1% b1T2%
A22737461.00%97431123209.00%
B347744.00%1452245496.00%
C19839950.00%1531712847812.00%
D30551959.00%1483714139610.00%
E22038058.00%100081219958.00%
Total A984005135700
Total B751223634.00%28237632901486.00%
All Total1735398544.00%33373385775239.00%

 

How can insert new row to the report by using Proc report. or how to insert values in existing row

Thanks,

SS

PaigeMiller
Diamond | Level 26

 

How did you get this table? Show us the code.

 

If we knew the answer to how you created this table, we could tell you the best way to do this (which may not be PROC REPORT).

 

--
Paige Miller
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Google search: sas proc report add total row

Quite a few results.  Show what code you have tried.

ballardw
Super User

1. Show the code you are currently using. Having to guess at variable names and the role any of the variables might have such as group, display or analysis means some suggestions may not work.

It might be possible to create a multilabel format for what ever variable is represented in your "name" column but it is not obvious which "names" might constitute "Total B" or "Total A" , which is a very poor way to reference things since you have specific values of A and B shown as well.

 

The online documentation for Proc Report shows an example that does something similar in result to what you want.

 

Note that the order of definition of statements in a multilabel format can change the order of appearance in the output.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 1379 views
  • 0 likes
  • 4 in conversation