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.
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.
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;
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;
Yes! Thank you. i simply put " *Sum = ' ' " and it stopped showing that row.
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.