Data visualization with SAS programming

Email Output from PROC GMAP using ODS msoffice2k

Frequent Contributor
Posts: 84

Email Output from PROC GMAP using ODS msoffice2k

Is it possible to send PROC GMAP output directly in the body of an Outlook email?  I have done this with other charts/tables and don't see a reason why GMAP would not work, however when I run the code below, it just outputs a table of data from my table, not an actual map.  I'm guessing this might be due to GMAP HTML output needing a .png file as well for SAS 9.2. Any insight is greatly appreciated!  Thanks!

/* Send Email */

option emailhost='localhost';

filename mymail email



     subject="GMAP Output"

  content_type="text/html" ;

ods MSOffice2K

body=mymail style=BarrettsBlue;

proc gmap



  id state;

  choro Group / levels=10  legend=legend1 coutline=black html=my_html;



ods msoffice2k close;

goptions reset=all;

/* Send Email */

Posts: 9,038

Re: Email Output from PROC GMAP using ODS msoffice2k

Hi: ODS MSOFFICE2K is an HTML based destination. This means that internally to the HTML, any image -- any logo, picture, graph is referenced with an <IMG> tag in the HTML. So when SAS creates output, in the absence of any instructions from you, the PNG image is created in the working directory of your SAS session. When ever you create an HTML file, whether with ODS HTML or ODS MSOFFICE2K, you need to send the HTML file itself and then any external files, like CSS or PNG files that the HTML files is referencing. This is an argument AGAINST using ODS HTML or ODS MSOFFICE2K for email. In fact, many email administrators do not want you to send HTML files in the body of the mail or even as attachments. Or, sometimes they block mail that contains HTML tags.

  It might be better for you to make an RTF or PDF file with ODS (in which the image will be embedded INSIDE the document and will not be a separate image), and then send the RTF or PDF file as an attachment.


Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation