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.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 3 replies
  • 663 views
  • 0 likes
  • 3 in conversation