The SAS Output Delivery System and reporting techniques

Error in publishing graphs to html page

Reply
Contributor
Posts: 24

Error in publishing graphs to html page

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"
contents= "/public/ant/testcontent.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;
run;

 

title "Parameters with Potential Differences in Metal";


ods html body ="/public/ant/testbody2.html";

 

/*Outputs those parameters of interest*/

data modelsub;
   set model;
   if LCLtotal > 0.1;
run;

 

proc print data= modelsub;
     var name;
run;


ods html body ="/public/ant/testbody3.html";

 

title "BoxPlots for Shared Graphs";

 

proc boxplot data= final;
     plot data*metal;
     by name;
run;


quit;

 

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!

Super User
Posts: 23,937

Re: Error in publishing graphs to html page

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.

Contributor
Posts: 24

Re: Error in publishing graphs to html page

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.

 

Apologies.

Contributor
Posts: 24

Re: Error in publishing graphs to html page

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?

Super User
Posts: 23,937

Re: Error in publishing graphs to html page

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;
Contributor
Posts: 24

Re: Error in publishing graphs to html page

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.

Super User
Posts: 23,937

Re: Error in publishing graphs to html page

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. 

Ask a Question
Discussion stats
  • 6 replies
  • 147 views
  • 0 likes
  • 2 in conversation