BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ammarhm
Lapis Lazuli | Level 10

Hi all

I just need help on this (rather annoying) issue which I (as a beginner) am not able to figure out how to solve

Many times when I run graphics, and when I am done with the graphics and want to move ahead to other procedures, I end up having a problem. Sas displays error message in the results windows about "This page cant be displayed"

This is an example of a procedure I just ran:

ods html file='groups' path='C:\temp\';

ods graphics on / width=8in imagefmt=html dpi=300 imagemap=on  border=off;

proc sgplot data=cat1;

vbar Disease /response=pct group=NIS groupdisplay=cluster;

xaxis label=' Disease Stage';

yaxis label='Percent';

run;


This code runs perfectly and the image is saved as I wanted in the temp file. But somehow this messes up all results afterwards than cant be displayed in SAS

Tried searching without luck, some suggestion didnt work for me

The only solution I have now is to restart SAS

Any ideas?

Best regards


1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Your code should be making an HTML FILE called c:\temp\groups (no file extension) and an image file named SGPLOT.png. IMAGEFMT=HTML is ignored, since it is not one of the valid IMAGEFMT values and the type of PNG is used instead,

as described in the doc: SAS/STAT(R) 9.22 User's Guide

  But in order to open the file groups, you need to give it a file extension or else, when you double click, you will probably get a snarky "what application" message. I recommend using some form of the code below. Give your FILE= option an explicit extension for the "wrapper" code and give your image an explicit name and format type. (AND close your open destination)

cynthia

ods html file='groups.html' path='C:\temp\';

 

ods graphics on / width=8in imagefmt=png imagename='wombat'

                  dpi=300 imagemap=on  border=off;

 

proc sgplot data=sashelp.class;

vbar sex /response=height stat=mean group=age groupdisplay=cluster;

run;

ods html close;

View solution in original post

2 REPLIES 2
ballardw
Super User

Without seeing the following code I'm going to guess that you aren't closing the ODS HTM destination or changing to a different output file. Other procedures may have issues with output sent to that destination file.

You may also want to turn ods graphics off after the SGPLOT procedure.

Cynthia_sas
SAS Super FREQ

Hi:

  Your code should be making an HTML FILE called c:\temp\groups (no file extension) and an image file named SGPLOT.png. IMAGEFMT=HTML is ignored, since it is not one of the valid IMAGEFMT values and the type of PNG is used instead,

as described in the doc: SAS/STAT(R) 9.22 User's Guide

  But in order to open the file groups, you need to give it a file extension or else, when you double click, you will probably get a snarky "what application" message. I recommend using some form of the code below. Give your FILE= option an explicit extension for the "wrapper" code and give your image an explicit name and format type. (AND close your open destination)

cynthia

ods html file='groups.html' path='C:\temp\';

 

ods graphics on / width=8in imagefmt=png imagename='wombat'

                  dpi=300 imagemap=on  border=off;

 

proc sgplot data=sashelp.class;

vbar sex /response=height stat=mean group=age groupdisplay=cluster;

run;

ods html close;

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
  • 2 replies
  • 918 views
  • 0 likes
  • 3 in conversation