ods html body='D:sas ext.html'; *创建一个text.html,将结果输出到这个文件里,可以创建多个输出,比如pdf等; proc print data=clinic.admit; run; *默认会弹出HTML和输出(list); ods html close; *将ods destination 关闭; ods listing close; *将默认输出listing 关闭; ods listing; *打开; ods html file='D:sas ext1.html'; *创建.html,如果已经创建,则添加在后面,file=body; ods pdf file='D:sas est.pdf'; proc print data=clinic.admit2; run; ods _all_ close; *对于打开了多个ods destination的话,all全部关闭; ods listing; ods listing close; ods html file='D:sasTEST2.HTML'; proc print data=clinic.admit3; var id name sex; run; ods html close; ods listing; ods listing close; *同时输出两个结果; ods html body='D:sasdata.html'; proc print data=clinic.admit label; var id sex age height weight actlevel; label actlevel='Activity Level'; run; proc tabulate data=sasuser.stress2; *制表 var resthr maxhr rechr; table min mean, resthr maxhr rechr; run; ods html close; ods listing; ods listing close; *为多个结果创建index,查看frame.html; ods html body='d:sasdata.html' contents='d:sas oc.html' frame='d:sasframe.html'; *html的名字是固定的,且有frame,必须有toc; proc print data=clinic.admit label; var id sex age height weight actlevel; label actlevel='Activity Level'; run; proc print data=sasuser.stress2; var id resthr maxhr rechr; run; ods html close; ods listing; ods listing close; *为多个结果创建index/table of contents,查看frame.html; ods html body='d:sasdata.html' (url='data.html') contents='d:sas oc.html' (url='toc.html') frame='d:sasframe.html'; *html的名字是固定的,且有frame,必须有toc; proc print data=clinic.admit label; var id sex age height weight actlevel; label actlevel='Activity Level'; run; proc print data=sasuser.stress2; var id resthr maxhr rechr; run; ods html close; ods listing; ods html body='c: ecordsdata.html' (url='http://mysite.com/myreports/data.html') contents='c: ecords oc.html' (url='http://mysite.com/mycontents/toc.html') frame='c: ecordsframe.html'; ods listing close; ods html path='D:sas' (url=none) body='data.html' contents='toc.html' frame='frame.html'; *用path省去部分重复; proc print data=clinic.admit; run; ods html close; ods listing; ods listing close; ods html path='D:sas' (url='http://mysite.com/myreports/') body='data.html' contents='toc.html' frame='frame.html'; proc print data=clinic.admit; run; ods html close; ods listing; ods listing close; ods html path='D:sas' (url=none) body='data.html' contents='toc.html' frame='frame.html' style=brick; *html的风格; proc print data=clinic.admit; run; ods html close; ods listing; ods listing close; ods html path='D:sasdata' (url=none) body='body.html' contents='contents.html' frame='frame.html' style=brick; *html的风格,无quotation!; proc print data=clinic.admit; run; ods html close; ods listing;
ods listing close; ods html body='E:sasdata.htm' /*和结果查看器一样*/ (url='data1.htm') contents='E:sascont.htm'/*创建了output的程序的索引*/ (url='tab.htm') frame='E:sasframe.htm'; *索引和结果一起显示; proc print data=sasuser.insure; var id name; run; proc print data=sasuser.admit; var id name; run; ods html close; ods listing; ods listing close; ods html path='E:sas' style= biege /*结果 右键 模板 sashelp tmplmst style*/ body='data.htm' /*和结果查看器一样*/ contents='cont.htm'/*程序的索引*/ frame='frame.htm'; *索引和结果一起显示; proc print data=sasuser.insure; var id name; run; proc print data=sasuser.admit; var id name; run; ods html close; ods listing;