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

Expecting either a quick and simple answer or a quick and simple no...can you put the sum row as row 1 on the table? Not a big deal but would make my life marginally easier if I could :D.

 

thank you in advanced.  

1 ACCEPTED SOLUTION

Accepted Solutions
6 REPLIES 6
Reeza
Super User
I don't believe so, but PROC REPORT can do that.
CharlesFowler72
Obsidian | Level 7
What I expected, thanks Reeza.
novinosrin
Tourmaline | Level 20

How I wish I saved the very demo by @ballardw in one of his posts for a very similar question using proc tabulate. I will wait if he responds

Reeza
Super User
PROC TABULATE is relatively easy, just put the ALL before the variable name.
novinosrin
Tourmaline | Level 20

is that all? really?

Reeza
Super User
proc tabulate data=sashelp.class;
class sex;
var age;
table (All='Both Sexes' Sex='') , age*MEAN=''*f=8.1;
run;

All before SEX means the total is at the top. Move all after and it's at the bottom. IN this case I used Mean, but you could replace that with SUM for a different report.

proc tabulate data=sashelp.class;
class sex;
var age;
table (Sex='' All='Both Sexes' ) , age*MEAN=''*f=8.1;
run;

The biggest difference is that PROC TABULATE is a summary procedure, where it summarizes the data. Whereas REPORT and PRINT are more used to display row level information. 

 

 

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 6 replies
  • 673 views
  • 6 likes
  • 3 in conversation