BookmarkSubscribeRSS Feed
Dani123
Calcite | Level 5

Hi,

I am currently working in an environment which (for further processing) requests the SAS graphics either in a catalog (as with the former PROC GPLOT) or if not, then a file with extension .eps.

But I want to create my graphics with PROC SGPLOT (SAS 9.2 is available). But I dont seem to get my figure from SGPLOT with ODS GRAPHICS into a File as "figurename.eps" .

The nearest I got was the following code, but when I try to view my .eps file for example with Word, then only "codetext" is shown.

goptions reset=all device=sasprtc vsize=5in;

ods listing close;

ods printer printer="PostScript EPS Color"

file="&path/figurename.eps" startpage=never;

run;

ods graphics on;

proc sgplot data=aaa;

... some statements ;

run;

ods graphics off;

run;quit;

ods printer close;

ods listing;

I tried also with ODS HTML and device=eps, but that didnt work at all. I always got the following message:

WARNING: Unsupported device 'EPS' for HTML destination. Using default device 'PNG'.

WARNING: tagsets.HTML4 destination does not support EPS images. Using the default static format.

Any Ideas what I am doing wrong?

Would it be possible to get the ODS GRAPHICS into a catalog? I am not very familiar with the two graphic worlds, least of all their differences ...

If I dont find a solution, I will have to re-pogramm my figures with PROC GPLOT.   Smiley Sad

Daniela

8 REPLIES 8
MikeZdeb
Rhodochrosite | Level 12

hi ... there may be an easier way, but this will at least get postscript (there's no encapsulated postscript IMAGEFMT)

there are free tools for PS to EPS conversion if you really need EPS

ods latex path="z:\";

ods graphics on / imagefmt=ps imagename='plot';

proc sgplot data=sashelp.class;

  scatter x=height y=weight / group=sex;

run;

ods graphics off;

ods latex close;

from page 4 in ... Creating Statistical Graphics in SAS 9.2: What Every Statistical User Should Know

DanH_sas
SAS Super FREQ

This can also be done with ODS LISTING. ODS LATEX is not required.

DanH_sas
SAS Super FREQ

Also, using IMAGEFMT=EPSI instead of PS should give you eps output.

MikeZdeb
Rhodochrosite | Level 12

hi ... just curious, if I use this ...

ods latex path="z:\";

ods graphics on / imagefmt=epsi imagename='plot';

proc sgplot data=sashelp.class;

  scatter x=height y=weight / group=sex;

run;

ods graphics off;

ods latex close;

I know where the EPS file is located, in folder Z:\

if I use the default LISTING destination (no path allowed), where does the EPS file go

ods graphics on / imagefmt=epsi imagename='plot';

proc sgplot data=sashelp.class;

  scatter x=height y=weight / group=sex;

run;

ods graphics off;

DanH_sas
SAS Super FREQ

You can use the GPATH option on ODS LISTING to control that output location.

MikeZdeb
Rhodochrosite | Level 12

Hi, thanks ... works like a charm.  Time to learn more about the the SG PROCS and all extra stuff (e.g. how to direct output) that I understand in the "non SG world".

Dani123
Calcite | Level 5

Great,

thank you both! It WorksSmiley Happy

It can be so easy when you know, where to define the format ...

JacobSimonsen
Barite | Level 11

I am still confused about available fileformats with ODS graphic. And I would therefore like to repeat the original question: Does anyone know how to produce graphics in EPS format with ODS?

From the documentation it seems that EPS should work with the ODS LISTING destination, but in practice it doesn't. The error message is

"ERROR: Unsupported image file format for output file."

Also, EMF format shold be possible with the RTF-destination. Then I get this error message:

"ERROR: Trying to open a key that does not exist: CORE\PRINTING\PRINTERS\\DEFAULT SETTINGS"

In practice, I therefore often use the old method where I produce the graphics with annotate and gplot. And I can put it to almost whatever format I want with the device option.

Jacob

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 10966 views
  • 6 likes
  • 4 in conversation