title 'The SAS System';

ods tagsets.excelxp file='ex1.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp file='ex2.xls' style=barrettsblue;

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp file='ex3.xls' style=fancyprinter;

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp options(doc='help') file='ex4.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp options(autofilter='all') file='ex5.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp options(autofilter='2-4') file='ex6.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp options(autofilter='2,4') file='ex7.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp options(width_fudge='1') file='ex8.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp 
      options(absolute_column_width='5,10,5,5,5,5'
              autofilter='2-4') file='ex9.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp 
      options(frozen_headers='1') file='ex10.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp 
      options(frozen_rowheaders='1') file='ex11.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp 
      options(sheet_name='Class data') file='ex12.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp 
      options(sheet_name='Class data') file='ex13.xls';

proc print data=sashelp.class;
run;
proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp 
      options(orientation='landscape') file='ex14.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp 
      options(embedded_titles='yes') file='ex15.xls';

title 'Making SAS Talk to Excel';
proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp 
      options(embedded_titles='yes') file='ex15.xls';

title 'Making SAS Talk to Excel';
proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp 
      options(print_footer='&amp;L&amp;D&amp;C&amp;A&amp;RPage &amp;P of &amp;N') file='ex16.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp 
      options(row_repeat='1' column_repeat='1') file='ex17.xls';

proc print data=sashelp.class;
run;

ods tagsets.excelxp close;

proc sort data=sashelp.class out=classsex;
   by sex;
run;

ods tagsets.excelxp file='ex18.xls';

proc print data=classsex;
   by sex;
run;

ods tagsets.excelxp close;

ods tagsets.excelxp file='ex19.xls';

proc report data=sashelp.class nofs missing;
   column sex name age weight height;
   define sex / order;
   break after sex / page;
run;

ods tagsets.excelxp close;

/*
filename email email                      
               attach=("ex19.xls")   
               to='jfh@alumni.stanford.org'  
               from='jfh@alumni.stanford.org'
               subject='Excel test ';     
                                          
data _null_;                              
   file email;                            
   put 'Results are attached.';           
run;                                      
*/
