0
votes

I am running bunch of tobit models on SAS. I want to transfer the output to Excel, but I want the output from all models to be in one Excel book (as opposed to creating one book for each model.) How would one do that? Many thanks.

I have the following code, but it only reports on of the results

  ODS TAGSETS.EXCELXP
  file='C:\Documents and Settings\Administrator\My Documents\...\Results.xls'
  STYLE=minimal
  OPTIONS ( Orientation = 'landscape'
  FitToPage = 'yes'
  Pages_FitWidth = '1'
  Pages_FitHeight = '100' );

  Proc qlim Data=AD.Data;
  class var1;
  model don =var1 var2;
  endogenous don ~ truncated (lb = 1);
  Run;

  Proc qlim Data=AD.Data;
  class var1;
  model don =var1 var2 var1*var2;
  endogenous don ~ truncated (lb = 1);
  Run;
  quit;
  ods tagsets.excelxp close;
1
Is it creating one workbook or one worksheet per table. You may need to set the option sheet_interval to 'never' - see support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html#dataMozan Sykol

1 Answers

0
votes

The ODS statement controls where output is written. To begin writing to a new "worksheet", use a new ODS statement with a different sheet_name.

Here is a simple example:

ods tagsets.ExcelXP file="SASHELP.CARS Analysis.xls"
                path="c:\temp" style=minimal;
ods tagsets.ExcelXP options(sheet_name="RawData" embedded_titles='Yes');
title "SASHELP.CARS Listing";
proc print data=SASHELP.CARS noobs;
run;
ods tagsets.ExcelXP options(sheet_name="MakeFreq" embedded_titles='Yes');
title "SASHELP.CARS Stats";
proc freq data=SASHELP.CARS;
     table make;
run;
ods tagsets.ExcelXP close;

Note the first ODS statement just defines the workbook destination and style. A separate ODS statement is used to define each work sheet.