03-22-2018 05:55 PM
I am trying to write my first html code for SAS using ODS and I"m clearly missing something.
I have some data that I want to publish that has, as far as this is concerned, three important columns, metal (the predictor), data (the response), and name (a separator for different models. One model per name, one boxplot per name) stored in the dataset "final"
In another data set, "model", which is actually a model output, there is a lower confindence level (LCL) of interest to denote parameters (names) of potential interest.
I keep getting errors that seemed to 'go away' partially when I added more body statements with different names.
ods html body ="/public/ant/testbody.html"
frame = "/public/ant/testframe.html";
title "Table of Total Rsquare Accounted for by Metal";
/*Outputs full list of parameters with LCLs listed*/
proc print data=model;
title "Parameters with Potential Differences in Metal";
ods html body ="/public/ant/testbody2.html";
/*Outputs those parameters of interest*/
if LCLtotal > 0.1;
proc print data= modelsub;
ods html body ="/public/ant/testbody3.html";
title "BoxPlots for Shared Graphs";
proc boxplot data= final;
ods html close;
ods graphics off;
I run into trouble with the boxplots. It says:
ERROR: Insufficient authorization to access /sas/config/Lev1/SASApp/boxplo77.png.
ERROR: Physical file does not exist, /sas/config/Lev1/SASApp/boxplo77.png.
for each boxplot it attempts to graph. It used to say the same thing until I added separate body statements.
Please help this html and sas noob. Thanks!
03-22-2018 06:01 PM
HTML doesn't embed the images in the file, it saves them externally and then references them which is likely what you're seeing.
If you are using SAS 9.4+ and can try ODS HTML5 it will embed the images and then is easier to work with, IMO.
This was asked and answered last week so if you search a bit you'll find some detailed write ups.
03-22-2018 06:03 PM
Thank you. I'm not sure what you mean or what even to search for precisely. I'm not aware of the technical language or even how to properly phrase my question to know how to find my answer.
03-22-2018 06:11 PM
It seems like it is trying to write the file somewhere that doesn't exist, or it lacks the ability to do so. How do I control where I write the file to for each boxplot created in a series?
03-22-2018 06:11 PM
Remove all ODS HTML references and use ODS HTML5 instead.
If you're building something more complex this may not work.
ods html5 file='/folders/myfolders/demo.html' style=meadow; proc means data=sashelp.class; run; proc means data=sashelp.cars; run; ods html close;
03-23-2018 01:56 PM
It's still throwing the same error with html5. I think I need to manually tell it where to save the graphs before publishing, as it seems to want to do it in a 'bad' place.
03-23-2018 03:41 PM
Yeah, you definitely have path issues and should resolve that first. But I'm not sure that's something we can answer. It depends on your set up and where you're allowed to save things. Since this is likely running on a SAS server, I would ask your SAS administrator where you should be saving things.