我在proc报告中遇到了一些问题,我不确定这是问题所在,还是可能是某个SAS选项。举个例子,下面的代码应该创建一个名为filename.XLS的XLS文件,其中有两张表。一张名为Summary,另一张称为Detail。相反,它创建了两个XLS文件,filename.XLS(包含摘要工作表(和filename1.XLS(包含详细信息工作表(。
我以前多次使用类似的代码,但都没有遇到这个问题。我尝试过关闭和重新打开SAS,以及重新启动我的电脑,但没有成功。此外,我还尝试过运行其他程序,我知道这些程序是有效的,它们包含类似的proc报告,现在它们都有这个问题。你知道可能出了什么问题吗?
ods listing close;
ods results off;
ods tagsets.excelxp file="c:tempfilename.xls" style=ESGExcel
options(sheet_name='summary'
embedded_titles='yes'
embedded_footnotes='yes'
frozen_headers='1'
);
proc report data = ds1 missing nowindows;
columns OWN
ABR
BBR
;
label OWN = 'SOMETHING1'
ABR = 'SOMETHING2'
BBR = 'SOMETHING3'
;
define OWN /
style(header)={font=('calibri',10pt,bold) just=c}
style(column)={font=('calibri',10pt) just=c cellwidth=1.0in};
define ABR /
style(header)={font=('calibri',10pt,bold) just=c}
style(column)={font=('calibri',10pt) just=c cellwidth=1.0in};
define BBR /
style(header)={font=('calibri',10pt,bold) just=c}
style(column)={font=('calibri',10pt) just=c cellwidth=1.0in};
title;
run;
ods tagsets.excelxp style=ESGExcel
options(sheet_name='detail'
embedded_titles='yes'
embedded_footnotes='yes'
frozen_headers='1'
);
proc report data = ds2 missing nowindows;
columns BSN
LSQ
OWN
;
label BSN = 'SOMETHING1'
LSQ = 'SOMETHING2'
OWN = 'SOMETHING3'
;
define BSN /
style(header)={font=('calibri',10pt,bold) just=c}
style(column)={font=('calibri',10pt) just=c cellwidth=1.0in};
define LSQ /
style(header)={font=('calibri',10pt,bold) just=c}
style(column)={font=('calibri',10pt) just=c cellwidth=1.0in};
define OWN /
style(header)={font=('calibri',10pt,bold) just=c}
style(column)={font=('calibri',10pt) just=c cellwidth=1.0in};
title;
run;
ods tagsets.excelxp close;
ods listing;
ods results;
解决方案:在桌面SAS中,转到"工具">"选项">"首选项"。在"结果"选项卡下,取消选中"创建HTML"。