BookmarkSubscribeRSS Feed
GPatel
Pyrite | Level 9

All:

I have SAS Code below, and upon SAS Job Execution, it doesn't render sgplot image. 

 

ods graphics on / outputfmt=png;
ODS HTML style=HTMLBlue file=_webout gpath= _ODSOPTIONS = options(BITMAP_MODE='inline');
 proc sgplot data=xxx  ;

title; footnote;

by year;

  xaxis type=linear min=&min_y. max=&max_y. values=(&min_y. to &max_y. by 1);

series x=time y=estrips / name="mrfss" lineattrs=(thickness=1.85 color=black) markers markerattrs=(size=3.5px color=black) break;
series x=time y=lower_eff / name="mrfss_ci" lineattrs=(thickness=1.7 pattern=ShortDash color=ligr) break legendlabel="95% Confidence Interval" markers markerattrs=(symbol=x size=4px color=gray);
series x=time y=upper_eff / lineattrs=(thickness=1.7 pattern=ShortDash color=ligr) break legendlabel=" " markers markerattrs=(symbol=x size=4px color=gray);

 

yaxis offsetmin=0 ;

run;

ods html close;
ods graphics off;

 

I am getting ...When I right click on the image, it can be open in another tab, and it shows the image.

 

GPatel_0-1734889061442.png

 

 

6 REPLIES 6
ChrisHemedinger
Community Manager

Some questions and considerations:

  • Where are you running this? Is it in SAS Viya or SAS Enterprise Guide? If using another coding environment like SAS Studio or SAS Enterprise Guide, these tools add their own ODS HTML5 statements that might interfere.
  • Speaking of ODS HTML5, I believe you should be using that (not ODS HTML) if you want embedded images (where the image data is part of the HTML and not a separate file).
  • You might also consider using SVG as the image format (scalable vector graphics), as that does well when embedded in HTML and of course the images render nicely even as you enlarge or shrink the view in the browser.
SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
GPatel
Pyrite | Level 9
Chris:
Happy Holidays !
I am using SAS JOB execution component.

Regards,
Gpatel

Ksharp
Super User
I think you could try BODY= and PATH= option of ODS HTML like:


ODS HTML style=HTMLBlue body='render.html' path='c:\temp\' ;
proc sgplot data=xxx ;
GPatel
Pyrite | Level 9
KSharp:
Thanks for reading and responding to my post.
I am using SAS JOB Execution, and sgplot doesn’t render images. When I right click, and show images, it displays though.

Any clue?
Happy Holidays!

Regards,
GPatel

Ksharp
Super User
I think the image rendered by proc sgplot is not under the same path with html file.
That why I use PAHT= option.
Talk to your SAS or OS Administrator to see if the image and html file are under the same path.

Also you could check 'ods listing gpath= ' which is the defaut path of image genreated by proc sgplot:

ods listing gpath='c:\temp\' ;
ODS HTML style=HTMLBlue body='render.html' path='c:\temp\' ;
proc sgplot data=xxx ;
.......

ODS HTML style=HTMLBlue body='render.html' path='c:\temp\' ;
proc sgplot data=xxx ;
GPatel
Pyrite | Level 9
Dear KSharp:

Thanks for your response, with detailed explanations. SAS VIYA JOB
Execution handles html / pdf / excel file output mechanism differently.
For Excel, it works with the following code :

filename f_xlxp filesrvc parenturi="&SYS_JES_JOB_URI"
name="NR.xml"
contenttype='application/vnd.ms-excel'
contentdisp='attachment; filename="test.xlsx"';

Appreciate your time and interest.

Thanks, GPatel

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 6 replies
  • 891 views
  • 0 likes
  • 3 in conversation