10-21-2013 06:18 AM
I have used the below syntax to generate the table.
ODS html body='D:\SAS Project\Output\sample3.xls';
proc tabulate data=prac.parents;
format gender gender. c2_2 prefer.;
class age gender c2_2/mlf preloadfmt order=data ;
tables all='Base :All Respondents'*f=9.0*N='' c2_2=''*colpctn='' ,(all='Total' gender)*f=7.2;
ODS html close;
|Base :All Respondents||365||227||138|
| Somewhat unfavorable||0.55||.||1.45|
| Somewhat favorable||46.85||48.9||43.48|
| Very favorable||27.95||31.28||22.46|
Query : please explain syntax to delete the empty column before "Total" column.
10-21-2013 06:38 AM
What empty column? It's not clear in the output what you mean.
Please search http://support.sas.com and this community for a solution before posting any new question in community.
10-21-2013 08:45 AM
Please run the above code at your end with your dataset, to know the problem. If you look at the output , u will realize there is a empty col before "Total col" which is not reflected when pasted.
10-21-2013 09:29 AM
It looks like your extra column is the unlabeled N and COLPCTN statistic. The only way I see around this is to transpose the table. Make the columns contain Total, Male, and Female, for example. When blank statistic labels appear in the column dimension of the table, the label gets entirely removed.
Somebody else may come up with another way around this, or perhaps the transposed version is acceptable.