The SAS Output Delivery System and reporting techniques

Is it possible to generate an EPS file using ODS LAYOUT?

Reply
New Contributor DYL
New Contributor
Posts: 3

Is it possible to generate an EPS file using ODS LAYOUT?

Hi,

I have created a composite figure for a publication using ods layout.  The figure is composed of 4 separate plots generated with 4 proc sgpanel  statements and one legend generated using a proc template and sgrender procedure.  I originally output it as a PDF using an ods pdf statement. 

 

ods listing gpath = "&path.\Images" image_dpi=300;
ods pdf file = "&Out.\Images\Fig1.pdf" notoc;
ods layout start width=8.3in height=7.05in;
* top left pane; ods region width=4in height=3in x=.1in y=.1in; proc sgpanel data = one noautolegend sganno=annoA; <code omitted > run; *top right pane; ods region width=4in height=3in x=4.2in y=.1in; proc sgpanel data = two noautolegend sganno=annoB; <code omitted > run;
*bottom left pane; ods region width=4in height=3in x=.1in y=3.2in; proc sgpanel data = three noautolegend sganno=annoc; <code omitted > run;
*bottom right pane; ods region width=4in height=3in x=4.2in y=3.2in; proc sgpanel data = four noautolegend sganno=annod; <code omitted > run; * footer; ods region height=0.75in x=.1in y=6.25in; ods graphics / reset noscale noborder maxlegendarea=100 width=4 in height=0.75in; proc sgrender data = sashelp.class template=legendonly; run; ods graphics/reset=all; ods layout end; ods pdf close;

 

However, the journal requires either a EPS or TIFF file to be submitted.  If I change the imagefmt in the ods graphics statement I can get the 5 separate epsi or tiff image files that comprise the components of the composite figure, but I don't know how to get the complete figure that results from the ods layout statement to come out in a different file format. 

Is there a way to use ods layout with anything other than ods pdf or ods powerpoint?  Alternatively, would adding a .eps filename extension to the the ods pdf statement (e.g. ods pdf file = "Fig1.eps") generate an EPS file?

I am using SAS 9.4 (TS1M3).  

Thanks

Super User
Posts: 13,913

Re: Is it possible to generate an EPS file using ODS LAYOUT?

If this were my project I would be tempted to create the image files and then embed them.

 

The ODS Graphics statement uses the option OUTPUTFMT to set the graphic output file format. You can create EPS with either ODS LIsting or ODS Printer output. Use the IMAGENAME="filename" option on ODS Graphics to set the file name. You may want to check with the documentation about supported image types and destinations as incompatible options sometimes take a while to trace down why my image doesn't work or you get PNG instead of TIFF. Use fully qualified filepath with the name to be sure you can find the output image file.

 

If you want a single image file with 4 graphs I suspect you might want to delve into GTL as it has layout options to do grids of graphs.

 

New Contributor DYL
New Contributor
Posts: 3

Re: Is it possible to generate an EPS file using ODS LAYOUT?

In this case I think the easiest thing to do is to post-process the image as Vince suggested below. But for future projects (with less time constraints) I will definitely look into the GTL option. Thanks for the suggestion
SAS Super FREQ
Posts: 364

Re: Is it possible to generate an EPS file using ODS LAYOUT?

Must the process be automated?  If not, then perhaps you can post-process the PDF file using a tool like this to create the EPS file:

 

https://image.online-convert.com/convert-to-eps

 

Vince DelGobbo

SAS R&D

New Contributor DYL
New Contributor
Posts: 3

Re: Is it possible to generate an EPS file using ODS LAYOUT?

Posted in reply to Vince_SAS
Thanks, Vince. That is probably the easiest thing to do in this case since it does not have to be automated.
Ask a Question
Discussion stats
  • 4 replies
  • 247 views
  • 4 likes
  • 3 in conversation