BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Fluorite | Level 6

I want to output my sgplot using EMFdual. I have tried several different options but the only option that has worked for me so far is:

ods graphics on / noborder;

ods html close ;

ods printer printer=emfplus;

This will print an EMF graph (print from my printer). Other options I have used appear to generate EMF but they are really PNGs.  This is obvious when I increase the size of the image.  If I can print an EMF, why cant I output it to a file? 


Accepted Solutions
Super User

Have you tried IMAGEFMT=EMFDual on the ODS Graphics statement?



View solution in original post

Super User

Have you tried IMAGEFMT=EMFDual on the ODS Graphics statement?



Fluorite | Level 6

This worked!!

Thank You Ballardw!

Fluorite | Level 6


My graph is width=4.5in height=3in, would you happen to know how I could get rid of the rest of the white space in my output?

Super User

Did you try specifing you desired height and width on the ods graphichs options statement?

Otherwise you may have to post a picture to indicate which white space and the procedure used to create it. If you need to do this the PNG style output would be preferable if it looks the same.

Fluorite | Level 6

I found that frame=off border=off distorted my image but if I use

options papersize=("4.5" "7") my image remains the same.

Super User

PAPERSIZE is not an option for ods graphics. It can affect document margins though.


ods graphics / width=5in height=6in;

You can use any of the measurement units such as cm, mm, pt (printers point) or px (pixels).


Border=off if used corretly should not "distort" image just remove lines around the graphic display area but since border may appear in many places it is hard to guess what may have happened. Frame can be something entirely different and I would have to see the entire syntax you used to guess what may have happened.

If you change the size of the graphics area you may want to consider using NOSCALE option to keep text size from getting enlarged/shrunk in proportion to the graphic display area

Fluorite | Level 6

ods _all_ close;

ods graphics on / reset=all width=4.5in height=3.0in noborder IMAGEFMT=EMFdual;

ods html close ;

ods printer printer=emfdual;

options nodate nonumber papersize=(4.8in 3.0in);

I still too much white space but the papersize seems to be working.  I can not get my grafout or file name to work.  Any suggestions on what might work?

This is the error I am getting.  It still generates an emf though.

ods _all_ close;

NOTE: ODS PRINTER printed no output.

(This sometimes results from failing to place a RUN

statement before the ODS PRINTER CLOSE statement.)

381 ods graphics on / reset=all width=4.5in height=3.0in

381! noborder IMAGEFMT=EMFdual;



WARNING 1-322: Assuming the symbol EMF was misspelled as


382 filename 'D:\Data\Whitney Parkhouse\SAS Programs\SAS Graph

382! Demo';

ERROR: Invalid logical name.

ERROR: Error in the FILENAME statement.

383 ods html close ;

384 ods printer printer=emfdual;


Barite | Level 11
This seems to produce an emf file. SAS does seem to default to png
especially with goptions, evem with device=EMF?

/* first 64 bytes of graph file */
/*   d              @          LO  `;   EMF   j  Þ       */

ods listing style=journal;
ods listing  gpath='d:/emf';
ods graphics on / width=8in imagefmt=emf imagename="emf";
proc sgplot data=sashelp.class;
scatter x=height y=weight / group=sex;
ods graphics off;

Super User

@rogerjdeangelis I think GOPTIONS are for SAS/GRAPH procedures and ODS GRAPHICS are for SG Procedures.

Barite | Level 11

Thanks Reeza


Learned somrthing new.


 You are correct, when I was using goptions SAS ignored goptions and  'defaulted' to png.

Fluorite | Level 6


This was new information for me too. Thanks Reeza

Fluorite | Level 6

Thank You rogerjdeangeli!



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 12 replies
  • 1 like
  • 4 in conversation