BookmarkSubscribeRSS Feed
abak
Obsidian | Level 7

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!

6 REPLIES 6
Reeza
Super User

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.

abak
Obsidian | Level 7

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.

abak
Obsidian | Level 7

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?

Reeza
Super User

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;
abak
Obsidian | Level 7

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.

Reeza
Super User

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. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 845 views
  • 0 likes
  • 2 in conversation