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.
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!
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.
Ready to level-up your skills? Choose your own adventure.