Hi Folks,
How to view .cgm ext file. What tool do we need to view it.Following is the sample code.
filename fileref 'C:\whisker_mean.cgm';
goptions
device = cgmof97l
gsfname = fileref
gsfmode = replace
reset = symbol
colors = (black)
chartype = 6;
Thanks in advance,
John
SAS has a paper that talks about generateing output from CGM files located at http://support.sas.com/techsup/technote/ts674/ts674.html maybe you can gleen sometihng from there.
TS-674 - An Introduction to Exporting SAS/Graph Output to Microsoft Office SAS Release 8.2 and higher
Thank you robby_beum , your reply helped me in finding the solution.
Did you try to open it with Internet Explorer? If the extension is for Computer Graphics Metafile, IE, Paintshop or similar program will probably open it.
Hi art297 ,
I tried opening the file using IE, Mozilla firefox but was not successful.
Thanks for the reply,
John
Can you attach the file to your post?
I am not able to attach the file. I have copy pasted some of the code.
If the following code is submitted , the cgm file will be saved in this location C:\whisker.cgm.
filenamefileref 'C:\whisker.cgm';
goptions
device = cgmof97l
gsfname = fileref
gsfmode = replace
reset = symbol
colors = (black)
chartype = 6;
The following sample first writes a CGM file to disk using the CGMOFML device driver. The code then uses the GIMPORT procedure to import the CGM file back into SAS®
/* Assign a fileref for the graphics */
http://support.sas.com/kb/25/551.html
/* stream file that will be written */
/* to disk. */
filename gsasfile 'c:\temp\sastest.cgm';
/* Turn off ODS styles */
options nogstyle;
/* Use the CGMOFML device driver to write */
/* a CGM file to disk */
goptions reset=all device=CGMOFML
border cback=white
gsfname=gsasfile gsfmode=replace
hsize=8 in vsize=6 in;
/* Write the CGM graph to disk */
proc gslide;
run;
quit;
/* Reset the graphics environment */
goptions reset=all cback=white border htitle=12pt htext=10pt;
/* Import the GSF file created by the CGM device driver */
proc gimport fileref=gsasfile
filetype=cgm
format=binary;
run;
quit;
source:
cgm files can be imported into powerpoint
you may need to make some changes to some of the powerpoint options to make them render correctly
Hi Bill ,
Could you please tell me what changes I need to make , to open .cgm files
in MS Powerpoint.
Thanks in advance,
John
John,
With Powerpoint I am able to open a cgm file by creating a new page and inserting the file as a picture.
art297,
Tried inserting .cgm file as a picture in Powerpoint but not successful. It showing an error "an error occured while importing this file".
John;
Someone else has already referred you to http://support.sas.com/techsup/technote/ts674/ts674.html#IIIB5a. (It's a good paper that you should read through from beginning to end). Although this references some older versions of PP, the problem may still exist in newer versions (I don't use cgm anymore. Now that we have ods I run almost everything into pdf. If I need something microsoft compliant, I use emf or png) There are some additional cgm tips here http://support.sas.com/kb/4/027.html. To get the full answer, you will likely need to surf through the microsoft website and look for KBs related to PP import filters.
John,
FWIW, I'm on Office2010 on an old thinkpad laptop running XP, and can import CGM files, flawlessly, using both PP and Word.
Obviously, I must be running something in the background, though, that you aren't. Possibly .NET
Hi Folks,
For time being I saving output with .jpeg format. Following is the sample code:
filenamefileref 'C:\whisker.jpeg';
goptions
device = jpeg
gsfname = fileref
gsfmode = replace
reset = symbol
colors = (black)
chartype = 6;
Thanks,
John
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.