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.
Daniela
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
This can also be done with ODS LISTING. ODS LATEX is not required.
Also, using IMAGEFMT=EPSI instead of PS should give you eps output.
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;
You can use the GPATH option on ODS LISTING to control that output location.
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".
Great,
thank you both! It Works
It can be so easy when you know, where to define the format ...
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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.