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

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? 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

 

 

View solution in original post

12 REPLIES 12
ballardw
Super User

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

 

 

Whitlea
Obsidian | Level 7

This worked!!

Thank You Ballardw!

Whitlea
Obsidian | Level 7

Ballardw,

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?

ballardw
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.

Whitlea
Obsidian | Level 7

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

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

ballardw
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

Whitlea
Obsidian | Level 7

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;

-------

1

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

EMFdual.

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;

 

rogerjdeangelis
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;
run;quit;
ods graphics off;


Reeza
Super User

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

rogerjdeangelis
Barite | Level 11

Thanks Reeza

 

Learned somrthing new.

 

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

Whitlea
Obsidian | Level 7

 

This was new information for me too. Thanks Reeza

Whitlea
Obsidian | Level 7

Thank You rogerjdeangeli!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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