BookmarkSubscribeRSS Feed
nnl3256
Obsidian | Level 7

I have generated html files using following code. In the generated html body and frame files, there are no graphic outputs generated. When open these two files, there is message displayed at bottom “Internet explorer restricts this webpage form running scripts or ActiveX”. Does anyone have idea? I am using Base SAS in version SAS 9.4 TS Level 1M4 running on W32_7PRO platform with OS windows version 6.

title;
title 'Comparing Group Means';

data Scores;
   input Gender $ Score @@;
   datalines;
f 75  f 76  f 80  f 77  f 80  f 77  f 73
m 82  m 80  m 85  m 85  m 78  m 87  m 82
;

proc ttest;
   class Gender;
   var Score;
run;

ods html close;
ods html body="&output\test.htm" contents="&output\testc.htm" frame="&output\testf.htm" style=HTMLBlue ;
ods graphics on;
ods graphics / reset
      imagemap=on
      width=4in
      height=6in ;

proc ttest data=scores;
   class Gender;
   var Score;
run;

ods html close;
ods listing;

 SAS 9.4 TS Level 1M4 running on W32_7PRO platform with OS windows version 6.

11 REPLIES 11
PaigeMiller
Diamond | Level 26

You want to set your default graphics to GIF or PNG.

 

goptions device=png;
--
Paige Miller
Reeza
Super User

For ODS isn't that set in the ODS Graphics statement? imagefmt?

PaigeMiller
Diamond | Level 26

I have never used the imagefmt option with ODS GRAPHICS. I do use the command I stated above.

--
Paige Miller
DanH_sas
SAS Super FREQ

Reeza is correct. To set the format of the ODS Graphics output, one should use the OUTPUTFMT (aka, IMAGEFMT) option on the ODS GRAPHICS statement.

 

Thanks!
Dan

PaigeMiller
Diamond | Level 26

@DanH_sas wrote:

Reeza is correct. To set the format of the ODS Graphics output, one should use the OUTPUTFMT (aka, IMAGEFMT) option on the ODS GRAPHICS statement.

 

Thanks!
Dan


I never do that, and I get PNG files.

--
Paige Miller
Reeza
Super User

@PaigeMiller wrote:


I never do that, and I get PNG files.


Probably because it's the default setting for HTML, though it looks like the option name is OUTPUTFMT= not IMAGEFMT.

 

HTML5 default is SVG for example. 

DanH_sas
SAS Super FREQ

Either OUTPUTFMT or IMAGEFMT will work. OUTPUTFMT is now the official option name.

nnl3256
Obsidian | Level 7

None of them works on my PC. path option works.  Thank you.

nnl3256
Obsidian | Level 7

This option doesn't help on my PC and path option works.  Thank you.

DanH_sas
SAS Super FREQ

The problem is how you put the paths in your ODS HTML options. Try this instead:

 

ods html path="&output" (url=none) body="test.htm" contents="testc.htm" frame="testf.htm" style=HTMLBlue ;

Both your graph output and the HTML files will be written to the PATH location. The (url=none) prevents the path from being written into the HTML output, making it easier to deploy your output.


Hope this helps!

Dan

nnl3256
Obsidian | Level 7

The problem IS how to set path= in ODS HTML options. Yes, it works by using code as you suggested. Thank you all!  

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 11 replies
  • 2210 views
  • 4 likes
  • 4 in conversation