SAS: Pros and Cons of Methods to Output SAS Results to Excel

  1. ODS tagset.excelxp
    • Con:can only output to .xml file, not xls or xlsx files;
    • Pro: use Proc Report by statement and output to separate spreadsheets;
  2. ODS html
    • Pro: can output to xls files;
    • Pro : use Proc Report can control label, column width and text wrapping;
    • Con: can’t use Proc Report by statement to output to separate spreadsheets;
ODS HTML BODY = 'C:\cars.xls' style=minimal;
PROC FREQ DATA=sashelp.cars ;
TABLES make*type type origin driveTrain enginesize cylinders horsepower mpg_city ;
ODS OUTPUT OneWayFreqs(match_all)=freqs;
RUN;
ODS HTML CLOSE;
DS HTML BODY = 'C:\cars.xls' style=minimal;
PROC MEANS DATA=sashelp.cars ;
VAR MSRP horsepower mpg_city;
CLASS type origin driveTrain ;
TYPES () type typeorigin typeorigin*drivetrain;
RUN;
ODS HTML CLOSE;