ODS html error: path not a directory

Code:

ods listing close;
ods html file="X:\Work\UG_AWARD\Validate\2223awards_oldcode.xls" style=journal;
proc tabulate data=hist.awards2223_sas missing f=dollar11. noseps;
class prog_fac level source level2 category awardname;
var awardamt;
tables level,source*level2*category all,awardamt=' ' / rts=40 indent=3 misstext='$0';
tables level,source*level2*category all,(prog_fac='Home Faculty' all)*awardamt=' ' / rts=40 indent=3 misstext='$0';
*tables level,source*level2*category*(awardname all) all,(prog_fac='Home Faculty' all)*awardamt=' ' / rts=40 indent=3 misstext='$0';
keylabel sum=' ';
run;

Error:

ERROR: A component of C:\Users\username\AppData\Local\Temp\SAS Temporary
       Files\computer_name\X:\Work\UG_AWARD\Validate\2223awards_oldcode.xls is not a directory.
ERROR: No body file. HTML output will not be created.

Reference:

SAS Support Usage Note 61280: The ODS HTML statement generates errors in the SAS® 9.4 TS1M5 windowing environment when the FILE= option includes a fully qualified path

Fix:

  • Tools>Options>Preferences…>Results
  • Uncheck “Use WORK folder”

Cause: The problem occurs because the “Use WORK folder” option is set as the default in the SAS registry and preferences. This causes the WORK folder to be prefixed to the path that is specified with the FILE= option. Separating the File and Path options can also fix the problem

SAS STAT: getting output statistics (2)

This post focus on the ODS Output for regression, including ANOVA, least square means, parameter estimates etc.

Each output from a SAS procedure has an associated name and label.  Each name is part of a name path, and each label is part of a label path.  In order to select, exclude, or modify an output table, you must first know its name.  Each level in the name path corresponds to a part of the procedure’s hierarchy of output that you can view in the Results window.

ods output 
parameterestimates = outputtable1 
fitstatistics =  outputtable2
overallanova = outputtable3
lsmeans = outputtable4
nobs = outputtable5
means = outputtable6;
ODS table name  Statement / Option Key Stats
ParameterEstimates Model / Solution Estimated linear model coefficients, t Value, Probability T, standard error
FitStatistics Default r-square, Coeff Var, Root MSE, dependent mean
OverallAnova Default DF, sum of squares, mean square, F value, Probability F
LsMeans LsMeans Least squares means are requested for each effect listed in the LSMEANS statement. LSMEANS can perform on classification variables and multiple comparison on interactions. LSMEANS are predicted population margins; that is, they estimate the marginal means over a balanced population.
Nobs Default Number of Observations
Means Means When variables in the Means statement is the same as in the Model statement, Means statement will provide the count of observations for each model effect or combination of effects.

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;