SAS-一个excel工作表上的多个过程报告



是否可以使用proc report在一个excel工作表上堆叠多个表?例如,下面是我的代码的简化版本,我想使用第一个proc报告显示表1,然后跳过一行,在同一工作表上显示紧挨着它的表2。

ods listing close;
ods results off;
ods tagsets.excelxp file="c:tempchar.xls" style=esgexcel ;
proc report data=table1 missing nowindows spacing=1;
column  field1
        field2
        field3 
        ;
define field1 /   'acct';
define field2 / format=mmddyy10.  'date';
define field3 / format=dollar22.2 'value';
run;
proc report data=table2 missing nowindows spacing=1;
column  field1
        field2
        field3 
        ;
define field1 /   'acct';
define field2 / format=mmddyy10.  'date';
define field3 / format=dollar22.2 'value';
run;
ods tagsets.excelxp close;
ods listing;
ods results;

但它不起作用。它将两个proc报告放在单独的工作表上。

您必须将sheet_interval=none选项添加到ods tagsets.excelxp:

ods tagsets.excelxp options(sheet_interval='none');

它将迫使SAS将所有后续表格(或署名或脚注等)放在同一张表中。如果您想更改表之间的间距(默认为1行),可以使用选项skip_space:

skip_space='x1,x2,x3,x4,x5'

其中:

x1=表格间距(默认值1)

x2=换行符的间距(默认为0)

x3=标题间距(默认为1)

x4=页脚间距(默认为1)

x5=分页间隔(默认值1)

最新更新