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

Hello,

 

I have managed to run Proc Tabulate with 3 pieces of data. However, upon running it, the results show a row labeled "Sum", below which, have the numbers I want. However, is there a way show these number without having the word "Sum". I am aware of simply doing proc print.

 

Capture1.PNG

 

Here is my code: 

PROC TABULATE DATA= sh.totals1 OUT= sh.tab1;
	VAR weight_agg agg_mort Total;
	Title Data1;
	TABLE weight_agg Total agg_mort;
RUN;

PROC TABULATE DATA= sh.totals2 OUT= sh.tab2;
	VAR weight_agg agg_mort Total;
	Title Data2;
	TABLE weight_agg Total agg_mort;
RUN;

PROC TABULATE DATA= sh.totals3 OUT= sh.tab3;
	VAR weight_agg agg_mort Total;
	Title Data3;
	TABLE weight_agg Total agg_mort;
RUN;

PROC TABULATE DATA= sh.totals4 OUT= sh.tab4;
	VAR weight_agg agg_mort Total;
	Title Data4;
	TABLE weight_agg Total agg_mort;
RUN;

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

See if this example helps?

 

 

 

You need something like TABLE sex ,(height weight) * mean = ' ' ;

 

PROC TABULATE data=sashelp.class;
CLASS sex;
VAR height weight;
TABLE sex ,
 (height weight) * mean = ' ' ;
RUN; 

as opposed to

 

PROC TABULATE data=sashelp.class;
CLASS sex;
VAR height weight;
TABLE sex ,
 (height weight) * mean ;
RUN; 

 

View solution in original post

3 REPLIES 3
novinosrin
Tourmaline | Level 20

See if this example helps?

 

 

 

You need something like TABLE sex ,(height weight) * mean = ' ' ;

 

PROC TABULATE data=sashelp.class;
CLASS sex;
VAR height weight;
TABLE sex ,
 (height weight) * mean = ' ' ;
RUN; 

as opposed to

 

PROC TABULATE data=sashelp.class;
CLASS sex;
VAR height weight;
TABLE sex ,
 (height weight) * mean ;
RUN; 

 

shril_21
Calcite | Level 5

Yes! Thank you. i simply put " *Sum = ' ' " and it stopped showing that row.

ballardw
Super User

If you have a complex table or multiple tables and want to change the appearance for all instances of one or more statistics that can be done similarly in a KEYLABEL statement.

 

Keylabel sum=' '; would change the behavior for all of the SUM requests in all tables for a proc tabulate call.

 

Additionally when doing multiple similar tables you might consider combining your data sets and adding a variable that identifies the source. Then use the combined data set with that variable as the PAGE dimension, one more row before the current table statements.

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1220 views
  • 0 likes
  • 3 in conversation