SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
whk2023
Fluorite | Level 6

Hello,

 

I am doing a homework which requires me to generate plots and tables in .html.

Below is my code, but the plot cannot be generated properly in webpage.

ods html path='path/Module07' (url=none) file='Q5_2.html' style= htmlblue;

ods graphics;

ODS PROCLABEL"Histogram plot";
title "Distribution of statistics knowledge";
proc sgplot data = homework.module00;
vbar status / response= Statistics_Knowledge;
run;
ods graphics off;

ods html close;

There is no error or warning in LOG. However the webpage shows as below:

whk2023_0-1697114941481.png

Does anyone know what the problem could be?

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Use HTML5 instead of HTML.

HTML doesn't embed images it links to it, so the images need to be somewhere as well.
HTML5 embeds images in the files so you don't need to consider where the image files are stored.

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

Show us the ENTIRE log for this code anyway. Please copy the log as text and paste it into the window that appears when you click on the </> icon.

PaigeMiller_0-1663012019648.png

--
Paige Miller
Cynthia_sas
SAS Super FREQ
Hi:
I suspect you may also need a GPATH= option to direct ODS where the image will be stored. But a lot depends on your PATH= option too. You are using a relative path reference in the PATH= option.
I would normally expect to see a fully qualified path location in the path= option something like:
ods html gpath='c:\temp' (url=none)
path='c:\temp' (url=none)
file='myhistogram.html';
The way you have it coded now, the path will be relative to your working directory unless you have edited the actual code to remove the fully qualified path. Hard to tell.
Cynthia
Reeza
Super User
Use HTML5 instead of HTML.

HTML doesn't embed images it links to it, so the images need to be somewhere as well.
HTML5 embeds images in the files so you don't need to consider where the image files are stored.
Cynthia_sas
SAS Super FREQ
Thanks @Reeza. I always forget to mention HTML5 and SVG as a possibility.
Cynthia

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1278 views
  • 6 likes
  • 4 in conversation