1
我遇到了一些proc報告問題,我不確定問題出在哪裏,或者它可能是SAS選項。作爲示例,下面的代碼應該創建一個名爲filename.xls的XLS文件,其中包含兩張表。一個叫Summary,另一個叫Detail。相反,它創建兩個XLS文件,其中包含Summary表單的filename.xls以及包含Detail表單的filename1.xls。SAS - Proc Report - XLS文件中的多個工作表問題
我以前使用的代碼很多次都沒有遇到過這個問題。我嘗試關閉並重新打開SAS,以及重新啓動我的電腦沒有運氣。另外,我試過運行其他程序,我知道這些程序包含類似的proc報告,現在他們也都有這個問題。任何想法可能是錯的?
ods listing close;
ods results off;
ods tagsets.excelxp file="c:\temp\filename.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;
這適用於我,就像你說的。您可以嘗試重新運行EXcel標記集代碼([在此處找到](http://support.sas.com/rnd/base/ods/odsmarkup/excltags.tpl))?也許你的已經損壞了。 – Joe
剛剛嘗試了你的建議。不幸的是,它沒有解決問題。雖然這是一個很好的想法。 – user2941280
然後,我會看你的安裝。這是桌面SAS?有什麼機會在你的配置文件或其他東西中改變了一些東西? – Joe