2017-03-14 34 views
0

私は、以下の2つのワークシート "woe_con_out"と "woe_cat_out"を同じExcel "woe_summary.xlsx"に作成しようとしています。このコードを実行すると、ワークシートが1つだけ生成されます(woe_cat_out)。どこが間違っていたのですか?sas ods excelは複数のワークシートを作成できません

data translate; 
format report $256.; 
infile "out_con.out" dlm='09'x dsd; 
input report $; 
run; 

ods excel file="woe_summary.xlsx" style = printer options(sheet_name = "woe_con_out") ; 
proc print data = translate noobs 
style(data) = {font_face = "courier_new" font_size = 11pt} 
style(column) = {width = 1000%}; 
run; 
ods excel close; 

data translate; 
format report $256.; 
infile "out_cat.out" dlm='09'x dsd; 
input report $; 
run; 

ods excel file="woe_summary.xlsx" style = printer options(sheet_name = "woe_cat_out") ; 
proc print data = translate noobs 
style(data) = {font_face = "courier_new" font_size = 11pt} 
style(column) = {width = 1000%}; 
run; 
ods excel close; 
+0

あなたはどのSASのバージョンをお持ちですか? (9.4、私は仮定しますが、TS1M#?) – Joe

答えて

2

は、各proc print文のods excel options文必要があります。また、あなたの状況では、私はあなたがそれらを上書きし、ことはできません2つのtranslateのデータセット、すなわちtranslate_contranslate_catを作成します

/* first ods excel statement includes the file and style */ 
ods excel file="C:\desktop\woe_summary.xlsx" style = printer; 

/* include ods excel options sheet_name for each PROC PRINT statement */ 
ods excel options(sheet_name = "woe_con_out"); 
proc print data = sashelp.class noobs; 
var _all_; 
run; 

/* same as above -- include ods excel options sheet_name for each PROC PRINT statement */ 
ods excel options(sheet_name = "woe_cat_out"); 
proc print data = sashelp.fish noobs; 
var _all_; 
run; 

/* close your ods excel engine */ 
ods excel close; 

を説明された方法を使用する。

+0

答えをありがとう! – vivi11130704

関連する問題