Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- How to suppress the 'blank' column in Proc Tabulat...

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-07-2015 02:36 AM

data test;

input group $ number;

datalines;

A 1

A 2

A 3

B 4

B 5

B 6

;

run;

ods html file = '..\test.xls';

proc tabulate;

var number;

class group;

tables number*(n mean median), group;

run;

proc tabulate;

var number;

class group;

tables number*(n='' mean='' median=''), group;

run;

ods html close;

The first proc tabulate inserts a column in Excel file with the name of the statistic (m mean median), while the second proc tabulate blanks those names, however, the column still remains. Is there a way to remove that column from the output?

Thanks!

Accepted Solutions

Solution

07-07-2015
01:40 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sas_Geek

07-07-2015 01:40 PM

Hi:

When you blank out statistic names in the row dimension with TABULATE, you can use ROW=FLOAT to remove/suppress the empty row header area for the statistic names:

**tables number*(n='' mean='' median=''), group /row=float;**

...if you add this table option to your 2nd TABULATE step, that should get rid of the statistic names. However, I would expect that the people using the report might find it confusing to know which row is the N, which the MEAN and which the MEDIAN if you suppress that information.

The documentation example that explains the behavior is here: Base SAS(R) 9.4 Procedures Guide, Third Edition, but you will see that they are only suppressing 1 statistic name (SUM), which is the ONLY statistic used in the example.

Here's a Tech Support note about it: 22751 - I am blanking out a statistic in my row dimension and the label is blank but the space has r... and here's another: 498 - The ROW=FLOAT option has no effect on the files created with ODS HTML,PRINTER or RTF (this behavior changed in SAS 9.1).

cynthia

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sas_Geek

07-07-2015 07:40 AM

Deleted as I was wrong. Thanks Cynthia!

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sas_Geek

07-07-2015 12:25 PM

You may want to provide what you want the table to look like. To suppress a column then don't ask for it. If you ask for N as a statistic you will get a column for it, if you don't want the column remove the statistic.

Solution

07-07-2015
01:40 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sas_Geek

07-07-2015 01:40 PM

Hi:

When you blank out statistic names in the row dimension with TABULATE, you can use ROW=FLOAT to remove/suppress the empty row header area for the statistic names:

**tables number*(n='' mean='' median=''), group /row=float;**

...if you add this table option to your 2nd TABULATE step, that should get rid of the statistic names. However, I would expect that the people using the report might find it confusing to know which row is the N, which the MEAN and which the MEDIAN if you suppress that information.

The documentation example that explains the behavior is here: Base SAS(R) 9.4 Procedures Guide, Third Edition, but you will see that they are only suppressing 1 statistic name (SUM), which is the ONLY statistic used in the example.

Here's a Tech Support note about it: 22751 - I am blanking out a statistic in my row dimension and the label is blank but the space has r... and here's another: 498 - The ROW=FLOAT option has no effect on the files created with ODS HTML,PRINTER or RTF (this behavior changed in SAS 9.1).

cynthia

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Cynthia_sas

07-08-2015 01:06 AM

Thanks, Cynthia! This is exactly what I was looking for.

Your doubt is valid, but the information regarding which row is N, Mean, etc. will be included within the Excel file that will be Output.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sas_Geek

07-28-2015 01:01 AM

Is it possible to get an output like this?

group | ||

A | B | |

number | ||

N | 3 | 3 |

Mean | 2 | 5 |

Median | 2 | 5 |

Instead of following two:

group | |||

A | B | ||

number | N | 3 | 3 |

Mean | 2 | 5 | |

Median | 2 | 5 |

OR

group | ||

A | B | |

number | 3 | 3 |

2 | 5 | |

2 | 5 |