how could the ODS Output dataset be output via xls similar to Tabulate that created it?

  • Follow


is there a simple way to process a ODS Output= dataset in the same xls
format, perhaps after adding a couple calculated row values as the
proc tabulate that created it ?

for example,

* random data;
data b;set sashelp.class; _at = (weight / height) * 100;format _at 5.;
h+1; if h=12 then h=0;
proc sort;by sex;

* this is the desired output format, created here via proc tabulate as
an example;

ods listing close;
ods noptitle;
ods html file="e:\class.xls" style=statdoc;
options nodate pageno=1 linesize=145 pagesize=160;
proc tabulate format=5. data=b noseps formchar='           ' ;
 title "class";
 class name sex age h ;
 var _at;
 by sex;
 table
(age='' all='Total')*  _at=' ',h='' *(sum=''*F=10.) all=''*F=comma12.
      /  rts=10 condense row=float;
run;
ods html close;
ods listing;

*ok, now we have a nice excel sheet, no problem with that;
* create  odsoutput;

ods listing close;
ods noptitle;
*ods trace on;
ods output table=odsoutput(keep=age name sex h _type_ _at_Sum);
options nodate pageno=1 linesize=145 pagesize=160;
proc tabulate format=5. data=b noseps formchar='           ' ;
 title "class";
 class name sex age h ;
 var _at;
 by sex;
 table
(age='' all='Total')*  _at=' ',h='' *(sum=''*F=10.) all=''*F=comma12.
      /  rts=10 condense row=float;
run;
*ods trace off;
ods html close;
ods listing;

question is, how could this odsoutput dataset be processed out same as
the proc tabulate that created it, where the h values run horizontal
across (see the first example e:\class.xls output).

in the actual example, some of the rows in the odsoutput dataset are
used to calculate new rows and then the goal is to send it all,
looking the same as the example proc tabulate that created it.


0
Reply sas 1/13/2011 3:42:30 PM


0 Replies
320 Views

(page loaded in 0.081 seconds)

Similiar Articles:










7/26/2012 12:21:49 AM


Reply: