Help using Base SAS procedures

export graph to jpg file, How?

Reply
Frequent Contributor
Posts: 128

export graph to jpg file, How?

Hi everyone,

How can we export graph (from proc gplot) to a jpg format file (or bmp, or other)?
Any example?

Thanks!
Trusted Advisor
Posts: 2,113

Re: export graph to jpg file, How?

Check the documentation for

OPTIONS DEV=JPEG;
Frequent Contributor
Posts: 128

Re: export graph to jpg file, How?

Thanks, can you tell me how?

Any example code, please?

Thanks a lot.
Super Contributor
Super Contributor
Posts: 3,174

Re: export graph to jpg file, How?

Explore the SAS support http://support.sas.com/ website and ODS with SAS/Graph generated outputs.

Scott Barry
SBBWorks, Inc.
SAS Super FREQ
Posts: 8,743

Re: export graph to jpg file, How?

Hi:
There are several different methods...depending on what kind of graphs you're creating (which procedure used):

A.) Device-based graphics (such as from PROC GCHART, GPLOT, etc)
--1) When you are looking at the graph in the GRAPH1 window, select
FILE --> Export As Image
or EDIT --> Edit Current Graph and then do a FILE --> Export from the Edit window;
--2) use ODS HTML with DEVICE=
--3) use FILENAME and GSFNAME and GSFMODE techniques with DEVICE=

B) Template-based graphics (such as from PROC SGPLOT, SGPANEL, etc or the use of ODS GRAPHICS ON/OFF with statistical procedures)
--1) Use the ODS GRAPHICS statement to control the IMAGEFMT= option however, these template-based graphics are already created as external files, so all you need to do is change the IMAGEFMT


Please note that these methods are all SEPARATE methods. That means if you're using ODS from A, you would -not- use method 1 or 3 and if you're using the Export method, you would -not- also use methods 2 or 3. Also you would not mix device-based methods (A) with template-based methods (B).

Searching Tech Support notes and the documentation should provide you plenty of examples and explanations.

cynthia
PROC Star
Posts: 1,562

Re: export graph to jpg file, How?

JPG is a bad format for "normal" graphs, where there are solid colors and sharp edges. PNG or even GIF would be better.
Ask a Question
Discussion stats
  • 5 replies
  • 304 views
  • 0 likes
  • 5 in conversation