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
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;
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.
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;
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.
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.
Ready to level-up your skills? Choose your own adventure.