The SAS Output Delivery System and reporting techniques

ODS HTML and ODS GRAPHICS

Reply
N/A
Posts: 0

ODS HTML and ODS GRAPHICS

I'm a bit confuse on how to modify the name of a graphics image file.

It seems like the only thing to do is to enable the IMAGENAME= option in the ods graphics statement, but it doesn't work well for me..
(ref: http://support.sas.com/rnd/app/da/stat/odsgraph/faq.html)

Would that be the problem that I use ODS HTML at the same time?

The following is my code:
ods html path = "C:\QA2"
gpath = "C:\QA2\gif" (url="gif/")
file = "test.htm";

ods graphics on / imagename = "MyName"
imagefmt = png;

proc gplot;
...
plot statement;
...
quit;

ods graphics off;
ods html close;



With this code, I was able to save the output in HTML format in C:\QA2 as well as graphics file (named gplot.png) in C:\QA2\gif. I was hoping the IMAGENAME option would change the name to MyName.png and save it at C:\QA2\gif. Am I missing something?

Thanks!!
SAS Employee
Posts: 174

Re: ODS HTML and ODS GRAPHICS

PROC GPLOT is not a statistical graphics procedure, and thus doesn't honor the ODS GRAPHICS statement. With SAS 9.2, the new PROC SGPLOT is production. It does honor the ODS GRAPHICS statement. (In fact, you don't even have to specify ODS GRAPHICS if you're happy with its defaults.)

You can learn about PROC SGPLOT here:

http://support.sas.com/documentation/cdl/en/grstatproc/61948/HTML/default/sgplot-chap.htm

-- David Kelley, SAS
SAS Super FREQ
Posts: 8,743

Re: ODS HTML and ODS GRAPHICS

And, for regular SAS/Graph procedures, most procedures support the NAME= option which would be the name that is used by SAS/Graph to assign a name to your file (other than GPLOT1, GPLOT2, etc)

If you look in the SAS/Graph documentation for your procedure of choice, you can see how and where the NAME= option goes.

cynthia
N/A
Posts: 0

Re: ODS HTML and ODS GRAPHICS

Thanks for the suggestions. I see both methods are useful, i enjoy exploring different ways to meet the same goal.

Also, when I tried to customized the plot, it seems like PROC GPLOT can be a better tool if the graph is fairly straight forward with fewer items to customized. Because we can simply specify the AXIS statement in order to modify the axis label, position, angle, major and minor ticks and etc. But if for PROC SGPLOT, we need to do it by changing the default template in PROC TEMPLATE.
SAS Super FREQ
Posts: 8,743

Re: ODS HTML and ODS GRAPHICS

Hi:
Actually, if you look at the documentation, you will see that SGPLOT, in particular has several AXIS statements that you can use without venturing into Graph Templates.
cynthia
http://support.sas.com/documentation/cdl/en/grstatproc/61948/HTML/default/xaxis-stmt.htm
N/A
Posts: 0

Re: ODS HTML and ODS GRAPHICS

That's very good tips. I must have missed that part.

Thanks!
Ask a Question
Discussion stats
  • 5 replies
  • 135 views
  • 0 likes
  • 3 in conversation