由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - [求助]用SAS建立多个工作簿的Excel文件
相关主题
可以用sas直接改excel的worksheet的名字么?Proc import 读excel文件,怎么略去前面几行?
proc export to Excel: can not read it!SAS proc import excel file 紧急求助
请教如何同时用sas打开多个excel文件?多谢!包子请教:SASoutput encoding的问题
R 读入excel 问题紧急求助Excel Vlookup问题
SAS的一个小问题如何用代码将多个sas数据集输出成csv文件
SAS 数据读入的问题 (proc import)SAS: automatically generate xls file with updated date
求救:SAS programmer面试题!怎样批量将很多的sas文件转换成stata文件?
export R data into Excel/WordIs the following SAS code wrong?
相关话题的讨论汇总
话题: sheet话题: demog话题: data话题: excel话题: ods
进入Statistics版参与讨论
1 (共1页)
k*****8
发帖数: 91
1
想把两个数据放入同一个Excel的不同工作簿里面。用了两种方法但是都是第二个
dataset把之前的一个dataset覆盖了(i.e.output里面只有demog这个dataset)。请问
这是什么原因?还有什么其他的方法能够实现在一个Excel里面建立多个工作簿?
data test demog;
input id $ sex $ age;
if sex='f' then output test;
else output demog;
datalines;
001 f 9
394 m 10
204 f 20
395 f 3
;
run;
/*Method 1*/
ods listing close;
ods tagsets.excelxp file="c:\temp\test4.xml" style=minimal;
ods tagsets.excelxp options(Sheet_Name='Class Data');
proc print data=test;
run;
ods tagsets.excelxp options(Sheet_Name='Demog Data');
proc print data=demog;
run;
quit;
ods tagsets.excelxp close;
/*method 2*//*I have tried to create an empty excel file with two sheets
named "Sheet 1" and "Sheet 2" respectively, but it gives out only one sheet
within that excel file*/
PROC EXPORT DATA =test
OUTFILE="c:\temp\test.xlsx"
DBMS= xlsx
REPLACE;
sheet = "Sheet1";
RUN;
PROC EXPORT DATA =demog
OUTFILE="c:\temp\test.xlsx"
DBMS= xlsx
REPLACE;
sheet = "Sheet2";
RUN;
l*********y
发帖数: 7
2
I just tried the second method you mentioned, and it worked.
1 (共1页)
进入Statistics版参与讨论
相关主题
Is the following SAS code wrong?SAS的一个小问题
如何从sas output里读入数据。SAS 数据读入的问题 (proc import)
SAS proc printto 问题。求救:SAS programmer面试题!
SAS EG输出到excel 2010多tab一直不行export R data into Excel/Word
可以用sas直接改excel的worksheet的名字么?Proc import 读excel文件,怎么略去前面几行?
proc export to Excel: can not read it!SAS proc import excel file 紧急求助
请教如何同时用sas打开多个excel文件?多谢!包子请教:SASoutput encoding的问题
R 读入excel 问题紧急求助Excel Vlookup问题
相关话题的讨论汇总
话题: sheet话题: demog话题: data话题: excel话题: ods