Hello:
I've searched the boards and have seen a number of questions on exporting editable graphics from SAS Studio but none of the proposed solutions have worked for me. I'm trying for an EMF file, if possible, but anything editable outside the SAS environment would be fine (this point is non-negotiable - our publications group needs editable graphics so please don't tell me to just format the graphics in SAS and export an image file). The most recent error message I get (repeated several times) is:
" WARNING: html5 destination does not support EMF images. Using the default static format."
The code otherwise runs fine and I get boxplots as both .emf and .sge which I can download but they are not editable; just images. Maybe my problem is not knowing how to edit these files, but inserting them into Word and PowerPoint doesn't allow any ungrouping or editing of the image.
The graphics output options in PROC MIXED seem more limited than in other procedures but I'm still trying the options. If exporting within SAS, then graphing/formatting with another procedure is an option, that would be good, too.
Here is my code, pointing the output to the SAS Studio server folder I can access, and using code from examples the community have provided to others with this issue:
Here is a blog that may help you get started:
https://blogs.sas.com/content/sgf/2021/08/17/editable-emf-graph-output/
For the Warning message, you can try adding the following before your opening ODS RTF statement:
ods _all_ close;
As mentioned in the comments of the blog post that Kathryn linked to, you might also try using SVG format.
Thank you, Kathryn. Your suggestion got rid of the error messages. Unfortunately, the blog post instructions have not worked so far. I've added their suggested steps and attempted to out and .emf file but just get zero byte files.
%let workdir=%trim(%sysfunc(pathname(work)));
data _null_;
file "&workdir./emf94.sasxreg";
put '[CORE\PRINTING\PRINTERS\EMF\ADVANCED]';
put '"Description"="Enhanced Metafile Format"';
put '"Metafile Type"="DUAL"';
run;
proc registry import="&workdir./emf94.sasxreg";
run;
I'm trying Quentin's suggestions of an .svg file but so far only get .html files with the graphics embedded in a form that won't open in anything but a browser (disappear when inserted into Word or PowerPoint, and don't seem to be selectable in the html file). This is what I've come up with so far to get anything but a zero byte file, preceding my PROC MIXED statements.
ods _all_ close;
ods html5 file = '/home/u58490928/sasuser.v94/growth/tpa.html' style=journal;
ods graphics / imagefmt=svg imagename="tpa";
ods html5 options (svg_mode="inline");
ods graphics /imagefmt=svg;
I'll keep at it but I'm getting frustrated that something that should be simple is so complicated (and so far, non-functional).
You are writing to HTML5 but the log shows this:
WARNING: html5 destination does not support EMF images.
I can write to an RTF file using the following:
%let workdir=%trim(%sysfunc(pathname(work)));
data _null_;
file "&workdir./emf94.sasxreg";
put '[CORE\PRINTING\PRINTERS\EMF\ADVANCED]';
put '"Description"="Enhanced Metafile Format"';
put '"Metafile Type"="DUAL"';
run;
proc registry import="&workdir./emf94.sasxreg";
run;
ods _all_ close;
ODS RTF file="Test Case2.rtf" nogtitle nogfootnote style=journal;
ods graphics on / reset=all outputfmt=emf attrpriority=none;
options nodate nonumber;
title1;
data cars;
set sashelp.cars;
where Make="Audi" or Make="BMW" or Make="Honda";
run;
PROC SGPLOT data=cars;
step y=weight x=Horsepower /group=make ;
styleattrs datacontrastcolors=(red blue green);
RUN;
ODS RTF close;
ODS LISTING ;
If you continue to have problems, I would suggest opening a case with Technical Support and include you SAS log.
I tried your code, Kathryn, but got an error which I've been seeing a lot this morning:
Below is my current code. Is it time for Technical Support?
%let workdir=%trim(%sysfunc(pathname(work)));
data _null_;
file "&workdir./emf94.sasxreg";
put '[CORE\PRINTING\PRINTERS\EMF\ADVANCED]';
put '"Description"="Enhanced Metafile Format"';
put '"Metafile Type"="DUAL"';
run;
proc registry import="&workdir./emf94.sasxreg";
run;
ods _all_ close;
ODS RTF file="Test Case2.rtf" nogtitle nogfootnote style=journal;
ods graphics on / reset=all outputfmt=emf attrpriority=none;
options nodate nonumber;
title 'TPA by forest type, blocking on island';
proc mixed data=growth.undamaged_conds method=reml plots=boxplot(observed);
class island ftypen cid invyr;
model tpa_live=ftypen / solution;
random island;
repeated invyr /subject=cid type=ar(1);
lsmeans ftypen / cl pdiff;
*ods output SolutionF=solution_fixed;
run;
ODS RTF close;
ODS LISTING ;
Thank you, Jeff. I guessed at where to modify the path and that worked. I was able to export an .rtf file which has the boxplots as objects that could be converted to Microsoft Drawing objects which I could then edit in Word.
I will also try .pdf files with Adobe Acrobat Pro (assuming my agency has not revoked our rights to use that again) which I think our publications people can use, too.
I'll work with what I can do now. Thank you all for your help. I've leared a lot today.
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.
Ready to level-up your skills? Choose your own adventure.