Data visualization with SAS programming

"This page cant be displayed" error

Accepted Solution Solved
Reply
Regular Contributor
Posts: 163
Accepted Solution

"This page cant be displayed" error

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



Accepted Solutions
Solution
‎04-05-2015 10:08 AM
SAS Super FREQ
Posts: 8,819

Re: "This page cant be displayed" error

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


All Replies
Super User
Posts: 11,114

Re: "This page cant be displayed" error

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.

Solution
‎04-05-2015 10:08 AM
SAS Super FREQ
Posts: 8,819

Re: "This page cant be displayed" error

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;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 356 views
  • 0 likes
  • 3 in conversation